There is no doubt that filtering by tag name first is much faster than filtering by classname.
This will be the case until all browsers implement getElementsByClassName natively, as is the case with getElementsByTagName.
More Related Contents:
- jQuery: load pages with ajax, caching, clean URLs and back button support
- When to use Vanilla JavaScript vs. jQuery?
- How to stop intense Javascript loop from freezing the browser
- What is the cost of ‘$(this)’?
- How to get nth-child selector to skip hidden divs [duplicate]
- Microsoft CDN for jQuery or Google CDN? [closed]
- Get unique selector of element in Jquery
- How to select all checkboxes with jQuery?
- Why cache jQuery objects?
- Get the DOM path of the clicked
- jQuery vs document.querySelectorAll
- Best way to execute js only on specific page
- Are data attribute css selectors faster than class selectors?
- One big javascript file or multiple smaller files? [duplicate]
- How do I use Browserify with external dependencies?
- Sort a table fast by its first column with Javascript or jQuery
- Javascript (jQuery) performance measurement and best practices (not load time)
- How to get numeric value from a prompt box? [duplicate]
- Include jQuery in the JavaScript Console
- Expose jQuery to real Window object with Webpack
- jQuery : select all element with custom attribute [duplicate]
- pass post data with window.location.href
- How to get the tag HTML with JavaScript / jQuery?
- Javascript algorithm to find elements in array that are not in another array
- How to make jQuery to not round value returned by .width()?
- Does scrollIntoView work in all browsers?
- How to set ChartJS Y axis title?
- Datatables TypeError: c is undefined
- How to highlight a part part of an Input text field in HTML using Javascript or JQuery
- How to check null objects in jQuery