Tag: firstelementchild
-
What is the difference between firstChild and firstChildElement in Javascript?
I was trying to get the value of the first list item of an unordered list using “firstChild” attribute. It threw error. I tried the same using “firstElementChild” and it worked! The difference it happens to be is: “firstChild” considers text entered in between html tags as a child element too in addition to html…