$this vs $(this) in jQuery

后端 未结 15 760
北恋
北恋 2020-11-29 18:07

I\'ve seen some discussions on SO regarding $(this) vs $this in jQuery, and they make sense to me. (See discussion here for an example.)

Bu

15条回答
  •  一生所求
    2020-11-29 18:28

    It just fills $this variable with $(this), so you do not have to lookup for $(this) element every call. It has better performance

    var $this = $(this);
    

提交回复
热议问题