Does Too many ids hurt performance

前端 未结 4 567
名媛妹妹
名媛妹妹 2021-01-17 07:59

If I have in the page unnecessary ids on elements, like the HTML Helper does in ASP.Net-MVC.
Does it reduce the performace of my i

4条回答
  •  别那么骄傲
    2021-01-17 08:41

    Selecting an id is extremely as fast, as jQuery backs up to the native

     document.getElementById
    

    function. Nevertheless, you can cache your selectors if you use them frequently (save them in a variable).

提交回复
热议问题