How do I use jQuery to select all children except a select element

后端 未结 7 864
甜味超标
甜味超标 2020-12-07 18:43

I have a div (let\'s say the id is \"container\") with many elements in it, including a select element. I\'d like to select all everything in the div except the select. Thin

7条回答
  •  眼角桃花
    2020-12-07 19:09

    Using :not, and .not() to select and filter » Live Demo

    The :not(selector) does exactly this, and it comes in a couple styles. You can use the selector, or the method. Below is an example of using the selector:

    $("#container :not(select)");
    

    This will match any child within #container that is not a

    提交评论

提交回复
热议问题