what does “return this.each()” do in jQuery?

后端 未结 5 978
轮回少年
轮回少年 2021-02-08 21:25

I\'m looking at a jQuery plugin, which has a single function. After setting up the appropriate defaults though a constructor argument the function defines a couple of helper fu

5条回答
  •  悲&欢浪女
    2021-02-08 21:36

    this make it possible to keep objects chain, so you can call jquery methods like this:

    $("selector").css().mouseover().etc().blahblah();
    

提交回复
热议问题