2012-08-29 24 views

回答

5

使用:not()

$("select minus select with ID like 'noChange'").onchange(function(){ 
    alert("change"); 
}); 

$("select:not(#noChange)").onchange(function(){ 
    alert("change"); 
}); 

或者,如果noChange是身份证的一部分,而不是确切的ID:

$("select:not([id*='noChange'])").onchange(function(){ 
    alert("change"); 
}); 
+0

对不起,如果我想用like?函数'formToJsonByIdLike(nameForm,like) { var jsonForm = {}; (函数(索引){jsonForm [$(this).attr(“id”)] = $(“输入,选择,复选框:[id * =”+ like +“]”,$(nameForm))。 this.value; }); return jsonForm; }' – Shinigami