我需要检测所有元素的 ALL 形式是否发生了变化,
我试过
$('input, select').change(function(){
alert(' work! ');
});
$('#formID').change(function(){
alert(' work too !');
});
$('textarea, input[type=radio]').change(function(){
alert(' Wont fire ?? ');
});
如何检测textarea,单选按钮和复选框的更改?
答案 0 :(得分:0)
$('#textareaID').bind('input propertychange', function() {
$("#yourBtnID").hide();
if(this.value.length){
$("#yourBtnID").show();
}
});
复制形式为here
和单选按钮更改
$("input[name=someRadioGroup]:radio").change(function () {
答案 1 :(得分:0)
$('#sampleName').change(function(){
alert(' work!');
});
$("input[name=sampleName]:radio").change(function(){
alert(' work!');
});