jQuery ancestors using jQuery objects

前端 未结 7 1784
北荒
北荒 2021-01-02 18:33

I\'d like to check ancestry using two jQuery objects. They don\'t have IDs, and are only going to be available as jQuery objects (or DOM nodes if you called get()

7条回答
  •  粉色の甜心
    2021-01-02 18:59

    Would you not get the result you want from simply using a CSS selector?

    $( '#div a' ).click( function() { ... } );
    

提交回复
热议问题