NextSibling in javascript USES a trap of da trap of keng

  • 2020-03-30 02:48:17
  • OfStack

Today, when writing js, I encountered a trap (da) (keng).

Problems with HTML/XML nodes

It is said that in IE nextSibling will not return text nodes, while chrome or firefox etc will return text nodes...

My work has created serious problems

Search on the Internet to a lot of processing methods, are to js to add a variety of encapsulated functions...

Then I found out there was a nextElementSibling method...

This does not return a text node, no matter what browser...

Is really a big pit

Also, there are corresponding for fistChild firstElementChild. Other functions that select nodes should have corresponding Element methods, but haven't tried them yet...

Then I suddenly found a fistChildElement ()... I guess this is from c++...


Related articles: