> Second: Stop using DOM libraries out of habit! If your target browser is IE8 or above, jQuery hardly provides any features that aren’t shipped on the host object anyway.<p>Nope, sorry, 9 times out of 10 the provision is theoretical and the interface is garbage. querySelector is pretty much the only one which does not suck — hence it being used as an example every single time.<p>* Querying or altering elements? Verbose shit.<p>* Binding events? Verbose shit.<p>* <i>Delegating</i> events? You've got 2 different specs, the most recent one is unimplemented and the older one is prefix-implemented everywhere (and useless as far as I know).<p>* Inserting elements in a DOM tree? Oh boy you're going to have a fun time manually traversing crap until you can reliably use insertBefore.<p>* Creating a node with text in it? You're in for 3 different statements, and that's if you're not trying to add attributes as well<p>* Manipulating classes? Hello broken regex search&replace. Oh you're targeting IE9 anyway? Well fuck you still, because Element#classList is IE10+.<p>* Playing with data-* elements? I hope you like getAttribute, because Element#dataset is MIA in MSIE.<p>* And bulk operations? What, you think querySelectorAll or getElementsByClass is going to return an array? Dream on, you <i>may</i> get something array-like in DOM4 if you're lucky. That means IE15, <i>maybe</i>.<p>Every single time I tried to get by with raw DOM, I fell back on zepto or jquery, life's too short for shit APIs and the DOM is exactly that. I don't code in raw DOM for the same reason I've stopped coding in assembly: I value my life more.<p>Now there are issues with jQuery, but these issues are generally that jQuery makes it easy to do the wrong thing (it's important to note that it <i>also</i> makes it easy to do the right thing, and improves that all the time, the "ease of doing the wrong thing" is just a side-effect of making things easier in general, the library does not specifically drive the user to the wrong thing) (except for animation maybe) e.g. keep doing noop work on empty selections, repeatedly select the same elements over and over again instead of caching the selection or not realizing you're doing a batch operation of adding a class or event on hundreds of DOM nodes in a single line.<p>The DOM itself does not fix this, it just makes these things so incredibly and obviously painful you look for other ways to do it to try and slightly alleviate the pain.<p>You get the same result out of <i>thinking</i>, and not blindly using jQuery.each and the like.<p>edits: formatting, classes manipulations, data-* attributes, matches/matchesSelector.