What is the difference between $.each(selector) and $(selector).each()

前端 未结 8 877
夕颜
夕颜 2020-12-07 12:59

What is the difference between this:

$.each($(\'#myTable input[name=\"deleteItem[]\"]:checked\').do_something());

and this:



        
8条回答
  •  情歌与酒
    2020-12-07 13:45

    From what I understand $.each(); loops through an object or array and gives you the iterator and value of each item.

    $().each(); loops through a list of jQuery objects and gives you the iterator and the jQuery object.

提交回复
热议问题