我禁用任何输入并使用以下代码进行选择:
var elements = ['#lbl1' ,'#lbl2','#lbl3','#lbl4','#lbl5','#lbl6','#lbl7'];
jQuery.each(elements, function(element) {
$(elements[element]).attr('disabled', true);
});
现在,如果用户单击用户的禁用标签警报,我想:
var elements = ['#lbl1' ,'#lbl2','#lbl3','#lbl4','#lbl5','#lbl6','#lbl7'];
jQuery.each(elements, function(element) {
$(elements[element]).click(function{
if ( $(elements[element]).attr() == 'disabled') alert('DISABLED');
});
});