This document discusses DOM selection and jQuery. It begins by explaining the DOM API and its levels. It then covers DOM selection methods like getElementById and querySelectorAll. It finds getElementById is typically fastest. The document also discusses CSS selectors and structural pseudo-classes. It shows querySelectorAll generally outperforms getElementsByTagName. Finally, it compares jQuery selector performance to native methods, finding native often faster, especially for structural pseudo-classes like :first-child versus jQuery's .first() method.
9. DOM API Performance Test
<ul>
<li>
<label>What's your name?</label>
<input id="inputBox" type="text" value="Huns">
</li>
</ul>
getElementById("inputBox");
getElementsByClassName("input-box")[0];
getElementsByTagName("input")[0];