jQuery: 如何从 .find() 中排除 ID?

jQuery: how to exclude IDs from .find()?

我有这个代码:

$("#someform").find("input:not[#myid]").change(function() {
....
});

但是代码不起作用。

任务: 我需要 select 所有 输入,但排除 ID="myid".

非常感谢您的帮助!

关闭,使用圆括号代替方括号

$("#someform").find("input:not(#myid)").change(function() {
....
});

:not()

:not() 的语法不正确,

$("#someform").find("input:not(#myid)").change(function() {
   //                       --^-- --^--
   ....
});

或者您可以使用 not()

$("#someform").find("input").not("#myid").change(function() {
   ....
});