A front end base -JQuery (each traversing Method)

Chapter 7 each way to iterate

  • jQuery implicit iteration on all DOM object is set to the same value, but if we need to give each object a different set of values, it needs its own iterate a.

Action: jQuery traversing a collection of objects, a function is executed for each matching element

// 参数一表示当前元素在所有匹配元素中的索引号
// 参数二表示当前元素(DOM对象)
$(selector).each(function(index,element){});
Released 1800 original articles · won praise 1922 · Views 170,000 +

Guess you like

Origin blog.csdn.net/weixin_42528266/article/details/105115275