排除单选按钮调用 Jquery 模糊函数
To exclude Radio button to call Jquery Function on blur
在我的表单中,我将输入字段作为文本、单选按钮和复选框。我在 'blur' 上绑定函数调用
输入字段。但我想排除单选按钮。所以在 'Radio button' JS函数的变化不应该得到
叫。
我当前的代码如下:
$('input, select').bind('blur', function () {
var target = this;
setTimeout(function () {
//some code here
}, 200);
});
如何从中排除单选按钮。
尝试.not
radio selector
$('input, select').not("[type=radio]").on('blur', function () {
或
$('input, select').not(":radio").on('blur', function () {
第一个更快
你可以这样做:
$('input[type!="radio"], select').on('blur', function () {
var target = this;
setTimeout(function () {
//some code here
}, 200);
});
在我的表单中,我将输入字段作为文本、单选按钮和复选框。我在 'blur' 上绑定函数调用 输入字段。但我想排除单选按钮。所以在 'Radio button' JS函数的变化不应该得到 叫。 我当前的代码如下:
$('input, select').bind('blur', function () {
var target = this;
setTimeout(function () {
//some code here
}, 200);
});
如何从中排除单选按钮。
尝试.not
radio selector
$('input, select').not("[type=radio]").on('blur', function () {
或
$('input, select').not(":radio").on('blur', function () {
第一个更快
你可以这样做:
$('input[type!="radio"], select').on('blur', function () {
var target = this;
setTimeout(function () {
//some code here
}, 200);
});