点击按钮在 表单文本框中添加内容/删除内容
作者:晋城网站建设 日期:2015-06-29
<input type="text" value="原始内容" id="xx"/>
<input type="button" value="内容一" onClick="f()">
<input type="button" value="内容二" onClick="w()">
<input type="button" value="清空" onClick="k()">
<script type="text/javascript">
function f(){
var xx = document.getElementById("xx");
xx.value = "内容一";
}
function w(){
var xx = document.getElementById("xx");
xx.value = "内容二";
}
function k(){
var xx = document.getElementById("xx");
xx.value = "";
}
</script>