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

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -