Skip to content

Comment on A Dive Into Plain JavaScript

Comments

great write up. one thing to remember when traversing the DOM using native APIs whitespace matters.

e.g. <div>#textnode

    <span>#textnode</span>#textnode

   </div>

Which can be safely ignored when using the firstElementChild, nextElementSibling properties and so on. They are not available in old browsers, but a polyfill should be available.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.