我有五个输入,其中一个名为 check 的类。如何使用 jQuery 仅填充五个输入的输入?
我不能使用验证器 jQuery 库。
这是 html 文件:
<input class="cheque" id="chmomtaz" placeholder="ریال" type="text" style="width: 100%" >
<input class="cheque" id="chkimia" placeholder="ریال" type="text" style="width: 100%" >
<input class="cheque" id="chrash" placeholder="ریال" type="text" style="width: 100%" >
<input class="cheque" id="chsandal" placeholder="ریال" type="text" style="width: 100%" >
<input class="cheque" id="chchob" placeholder="ریال" type="text" style="width: 100%" >
最佳答案
@hasan movahed 你的解决方案会起作用,但是,如果我了解你的需求,可以这样:
$('.cheque').on("keyup", function() {
$('.cheque').not(this).val('');
});
这将删除所有其他输入内容而不禁用它们
关于jquery - 如何用 jQuery 只填充两个输入中的一个输入?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39314923/