<html>
<head>
<script>
//同步函数
function synchronize(){
...
<html>
<head>
<script>
//同步函数
function synchronize(){
document.getElementById('i1').value =document.getElementById('i2').value;
//alert("同步成功");
}
//执行同步
setInterval(synchronize,100);//同步的时间间隔,每0.5秒同步一次
</script>
</head>
<body>
在第二个输入框中输入字符,会自动同步到第一个输入框。<br/><br/>
第一个输入框:<input type="text" size="45" id="i1" name="first" readonly="readonly"><br/><br/>
第二个输入框:<input type="text" size="45" id="i2" name="second">
</body>
</html>阅读全文