DEV Community

Discussion on: JavaScript DOM

Collapse
 
abhinav1217 profile image
Abhinav Kulshreshtha

I think you made a typo, getElementTagName should be getElement*sBy*TagName same thing for ClassName. Also TagName and ClassName returns an array of nodes, while getElementById will return first node on the tree.

Also I always wondered, will getElementsByTagName work on custom elements or react components?