Difference between $(this) and this in jquery

前端 未结 7 2042
灰色年华
灰色年华 2020-11-28 07:40

What is the fundamental difference between using $(this) vs this

$(\'.viewComments\').click(function(ev){
    //returns the desired value
    alert(this.getA         


        
相关标签:
7条回答
  • 2020-11-28 08:01

    Here are two articles that you may find helpful:

    What is this? by Mike Alsup

    jQuery's this: demystified by Remy Sharp

    0 讨论(0)
提交回复
热议问题