jQuery - selecting elements from inside a element

前端 未结 7 1564
广开言路
广开言路 2020-12-02 08:19

let\'s say I have a markup like this:

... ... ...

and

相关标签:
7条回答
  • 2020-12-02 09:03

    Actually, $('#id', this); would select #id at any descendant level, not just the immediate child. Try this instead:

    $(this).children('#id');
    

    or

    $("#foo > #moo")
    

    or

    $("#foo > span")
    
    0 讨论(0)
提交回复
热议问题