jQuery selector inside the each() method

后端 未结 5 1521
暗喜
暗喜 2020-12-31 12:32

Lets say that I have a HTML that looks like this:

1
2
5条回答
  •  离开以前
    2020-12-31 13:01

    If that's your actual markup, you can easily use the native property firstChild.

    $('.aaa').each(function(){
        var x = this.firstChild
    });
    

    It is a widely supported property.

提交回复
热议问题