jQuery : eq() vs get()

前端 未结 8 1225
挽巷
挽巷 2020-11-28 03:50

I\'m new to jQuery, and I\'m wondering what the difference is between jQuery\'s get() and eq() functions. I may misunderstand what the get()

8条回答
  •  佛祖请我去吃肉
    2020-11-28 04:40

    To build on the other answers:

    $('h2').get(0) === $('h2').eq(0)[0]  //true
    $( $('h2').get(0) ) === $('h2').eq(0)  //true
    

提交回复
热议问题