我想知道是否有一种方法可以调整此代码,以便在单击提交按钮时,它将消失,但输入框将保留.
<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>
Run Code Online (Sandbox Code Playgroud)
只需添加:
button.style.visibility = "hidden";
Run Code Online (Sandbox Code Playgroud)
在你的SetInput功能结束时.
| 归档时间: |
|
| 查看次数: |
24285 次 |
| 最近记录: |