当我检查文件并提交表单时,我想要更改文本。这是我的表格
$(" #client-form input[type='file'], .webform-client-form input[type='file'], #contact-form input[type='file']").click(function() {
$(this).change(function(){
$('p.pull-left > span').text('Attached');
});
});
我已经检查了类型为text的输入。如果它有效,我删除边框,此时我的操作工作,并更改我的文本“附加”,但我没有点击这个字段,也没有附加任何东西。请帮帮我
发布于 2015-09-11 09:03:52
对.click()
事件直接使用.change()
,而不是绑定:
jQuery(function($) {
$('#client-form input[type=file], .webform-client-form input[type=file], #contact-form input[type=file]').on('change', function() {
$('p.pull-left > span').text('Attached');
});
});
当元素的值发生更改时,会将更改事件发送给该元素。
https://stackoverflow.com/questions/32519480
复制相似问题