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

前端 未结 8 883
夕颜
夕颜 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:57

    from http://api.jquery.com/jQuery.each:

    The $.each() function is not the same as .each(), which is used to iterate, exclusively, over a jQuery object. The $.each() function can be used to iterate over any collection, whether it is a map (JavaScript object) or an array.

提交回复
热议问题