Today I encountered a trap (da) when writing JS (keng)
Questions about HTML/XML nodes
It is said that nextSibling will not return text nodes in IE, while chrome or firefox will return text nodes...
This has caused serious problems in my job
I have searched many processing methods online, all of which are adding various encapsulated functions to js...
Later I found out that there is a nextElementSibling method...
This will not return a text node, no matter what browser it is...
What a big pit
Similarly, there is a corresponding firstElementChild for fistChild. Other node-selecting functions should also have corresponding Element methods, but have not tried it yet...
Then I suddenly found a fistChildElement()...⊙⊙b Khan, I guess this is in C++...