2 ms·
Fair arguments; the selector engine is flexible and terse. $.html() was great but I prefer createElement() because it guarantees I'm working with valid HTML, vs
by cantSpellSober 3y ago
Fair arguments; the selector engine is flexible and terse. $.html() was great but I prefer createElement() because it guarantees I'm working with valid HTML, vs $.html("my typo here").
Interesting the article uses innerHtml in its helper function, jQuery's .html() method itself includes the comment "See if we can take a shortcut and just use innerHTML"
https://github.com/jquery/jquery/blob/4a13266efd262a92f05d86b71d715885de103e6d/src/manipulation.js#L262-L299 https://github.com/jquery/jquery/blob/4a13266efd262a92f05d86...