Skip to content

Faster jQuery ID selector

Sometimes you may are concerned with performance about things like jQuery selectors. But as long as your only need to select by an ID, you can as well use the native document.getElementById() function:

[sc name=”src” url=”https://stackoverflow.com/questions/1854859/jquery-performance-wise-what-is-faster-getelementbyid-or-jquery-selector” ]

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.