jsp页面中,用javascript实现一个输入框中的值根据另外一个输入框中的值的改变而改变

如题所述

第1个回答  2010-04-29
在第一个输入框中写onpropertychange事件
<script type="text/javascript">
function change(aa)
{
document.getElementById("2").value=aa;
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<form>
<input type="text" id="1" onpropertychange="change(this.value)"/>
<input type="text" id="2""/>
</form>本回答被网友采纳
第2个回答  2010-04-29
function changeValue(value){
document.getElementBy("xx").value=....
}
<input type="text" onpropertychange="changeValue(this.value)"/>
<input type="text" id="xx"/>
第3个回答  2010-05-04
function changetargeValue(obj){
document.getElementById("object").value=obj.value;

}

<input type="text" name="target"/>
<input type="text" name="object" onchange="changetargetValue(this)"/>
相似回答