$this vs $(this) in jQuery

后端 未结 15 808
北恋
北恋 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:26

    $ sign is usually used before variable names in JavaScript to differentiate between general value and jQuery object. So here $this just gets the value of $(this) which returns jQuery object of this. $ is just a part of valid variable name.

提交回复
热议问题