Why doesn't $.each() iterate through every item?

后端 未结 3 1244
有刺的猬
有刺的猬 2020-12-09 01:24

I have the following markup containing 10 pre elements with the class indent:




        
3条回答
  •  有刺的猬
    2020-12-09 01:49

    $.each iterates over a collection of data. Since you pass a String that have 7 chars, it will iterate for each char. See the example of use:

    $.each([52, 97], function(index, value) { 
      alert(index + ': ' + value); 
    });
    

提交回复
热议问题