我想要做的是选择文档上的所有输入按钮,除了那些位于特定ID下的按钮。如何选择除特定ID以外的所有输入?
实施例:
<body>
<input type="button">
<div id="something">
<input type="button">
</div>
<div id="something2">
<input type="button">
</div>
<input type="button">
<input type="button">
<input type="button">
</body>
例如,我想选择所有的输入,除了那些位于下<div>
其id
是“东西”。
我已经试过:
1) $('input[type="button"]:not(:parent(#something))').addCSS();
2) $('input[type="button"] :not(#something input[type="button"])')
与其他类似的方法
[JQuery Selector for not“wrapped”elements]的可能的重复(http://stackoverflow.com/questions/11924672/jquery-selector-for-not-wrapped-elements) – Blazemonger 2013-02-27 21:12:36