我想知道是否有一种方法我可以适应此代码,以便当点击提交按钮时,它将消失,但输入框将保留。使提交按钮消失点击时
<script type="text/javascript">
var Text = 'hello';
function setInput(button) {
var buttonVal = button.name,
textbox = document.getElementById('input_' + buttonVal);
textbox.value = Text ;
}
</script>
<html>
<input class='input' id="input_a1" name="a1" value="<?php {echo $a1;} ?>">
<input type='submit' name='a1' value='x' onclick='setInput(this); return false;'>
</html>
感谢所有的帮助它的大加赞赏。它的工作很好 – user1559811