求网页代码,可以点击按钮自动添加到输入框中指定内容

来源:百度知道 编辑:UC知道 时间:2024/05/17 04:52:05
<input name="name" type="text" id="name" size="28"><button onClick="P();">粘贴</button><input name=clear type=reset value=清空>

想增加个按钮,可以点击按钮自动添加到输入框中指定内容

拜托~

<form action="" method="get" name="" id="form">
<input name="name" type="text" id="name" size="28"><button onclick="P()">粘贴</button>
<input name=clear type=reset value=清空>
</form>

<script>
function P(){
form.name.value="粘贴的内容"
}
</script>