我不想清除整个表单只是参考输入框,如下所示。
<tr>
<td>Reference *</td>
<td>
<!--<input type='Text' name='reference_ABC' size='3' maxlength='3' style='width:75px;font-family:Century Gothic'>-->
<input type='number' id='a' name='reference_end' required size='7' maxlength='1' style='width:90px;font-family:Century Gothic; text-transform:uppercase; '>
<input type='Text' id='b' name='reference_end' required size='7' maxlength='3' style='width:140px;font-family:Century Gothic; text-transform:uppercase;'>
<input type='number' id='c' name='reference_end' required size='7' maxlength='6' style='width:190px;font-family:Century Gothic; text-transform:uppercase;'>
</td>
</tr>
答案 0 :(得分:2)
你可以像这样使用它:
<button id="resetButton">Reset</button>
<script type="text/css">
$('#resetButton').click(function() {
$("[name='reference_end']").val("");
});
</script>
答案 1 :(得分:1)
您可以使用
$("[name='reference_end']").val("");
答案 2 :(得分:1)
<button class="reset">Reset the input</button>
<script>
$('button.reset').click(
function(){
$("[name='reference_end']").val("");
});
</script>