Jquery .each through Divs inside another Div

后端 未结 4 664
一个人的身影
一个人的身影 2021-01-11 14:00

I currently have the following html:

Apologies for edit, I was not paying attention when i wrote this.

 
1&
相关标签:
4条回答
  • 2021-01-11 14:32
    $.each( $('.left'), function(i, left) {
       $('div', left).each(function() {
    
       });
    })
    
    0 讨论(0)
  • 2021-01-11 14:40
    $(".left").children().each(function(i, elm) {
        alert($(this).html())
    });
    
    0 讨论(0)
  • 2021-01-11 14:48

    Is this what you're lookng for?

    $('div.left>div').each(function(){ /* do stuff */ });
    

    Fiddle: http://jsfiddle.net/MLnBY/

    0 讨论(0)
  • 2021-01-11 14:50

    The syntax would be $(".left > div").each(function(){}); instead of .each(".left > div").

    Update: Would want to use $(".left").children().each()

    0 讨论(0)
提交回复
热议问题