+ 2
GetElementbyId Properties
What are more properties in getelement.id apart from style. color, background, and value?
2 odpowiedzi
+ 1
Hi love
There is getElementbyID and getElementsbyID (notice the small difference).
We also now have document.querySelector and its matching document.querySelectorALL.
The latter allows you to target an elements by its CSS attributes.
All of an elements properties are accessible using above, so what is the difference?
see this discussion
https://www.sololearn.com/Discuss/1218711/get-vs-query
0
Hello there!
.innerhtml - allows you to manipulate the HTML inside the element;
.attributes - let's you access element's attributes;
.childNodes - returns an array of elements inside the element with that ID;
Etc, but personally this bunch were enough for me to manage quite some stuff during projects ahahah doing a quick Google search you'll find more info regarding this matter and a bunch of examples