What's the difference between '$(this)' and 'this'?

前端 未结 7 1571
面向向阳花
面向向阳花 2020-11-21 07:18

I am currently working through this tutorial: Getting Started with jQuery

For the two examples below:

$(\"#orderedlist\").find(\"li\").each(function          


        
7条回答
  •  抹茶落季
    2020-11-21 07:55

    Yes, you need $(this) for jQuery functions, but when you want to access basic javascript methods of the element that don't use jQuery, you can just use this.

提交回复
热议问题