取消选择原本将由班级选择的ID [英] Deselect an ID that would otherwise be selected by class

查看:62
本文介绍了取消选择原本将由班级选择的ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面,其中所有输入都分配有一个行为: $("input").blur(function(){

I have a page where all inputs are assigned a behavior: $("input").blur(function () {

,我需要排除具有特定ID的复选框:

and I need to exclude a checkbox that has a specific id:

  <input type="checkbox" id="allButMe" onchange="billingSameChanged();" value="true"/> 

thx

推荐答案

使用 jQuery的not选择器像这样:

Use jQuery's not selector like this:

$("input:not(#allButMe)").blur(function() { });

这篇关于取消选择原本将由班级选择的ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆