Benefits of using attr() over addClass in jquery

后端 未结 5 1682
野性不改
野性不改 2020-12-03 08:07

What are the benefits of using attr() instead of using addClass() in jquery?

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-03 09:07

    .addClass() is MUCH better for performance.

    Check out this guide to jQuery performance: http://net.tutsplus.com/tutorials/javascript-ajax/10-ways-to-instantly-increase-your-jquery-performance/

    One of my favorite articles.

提交回复
热议问题