jquery - Does the length of the selector affect the speed? -


so in cases better code readability use div#parent div.someclass a, can div.someclass a. version better , faster?

it's important when using jquery consider selectors have converted native browser functions @ end of day. means should try use id or tag based selectors whenever possible. recommend using $("div#parent").find("div.someclass a") better performance

this gives better performance since use optimized tag/id selector parent, , slower class based selector applied more limited set since applied descendants of specified parent.


Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

php - Boolean search on database with 5 million rows, very slow -

css - Text drops down with smaller window -