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)"/>

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网