如何循环所有ul标记并使用JQuery在其上实现函数?
如何循环使用特定类名的所有如何循环所有ul标记并使用JQuery在其上实现函数?,jquery,foreach,css-selectors,Jquery,Foreach,Css Selectors,如何循环使用特定类名的所有ul标记并在其上实现函数 我试过了,但没用 $("ul.innerContainer").foreach(function(){ //do something with the element }); 它是each()而不是foreach() 方法被调用,而不是foreach 差不多了: $("ul.innerContainer").each(function(){ // do something with '$(this)' }); $('ul.inn
ul
标记并在其上实现函数
我试过了,但没用
$("ul.innerContainer").foreach(function(){
//do something with the element
});
它是each()
而不是foreach()
方法被调用,而不是foreach
差不多了:
$("ul.innerContainer").each(function(){
// do something with '$(this)'
});
$('ul.innerContainer').each(function(index) {
//function here
});
$("ul.innerContainer").each(function(){
// do something with '$(this)'
});