3.在一个文本框输入信息时,在另一个文本框同步显示(onkeyup)
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<!-- onkeypress:当键被按下并松开时起作用,会导致第二个同步框比第一个迟缓一步
onkeydown:当键被按下时起作用,同样会迟缓一步
onkeyup,当键松开时起作用-->
<input id="one" onkeyup="changefun()">
<input id="two">
</body>
<script type="text/javascript">
function changefun() {
// var val = document.getElementById("one").value;
// document.getElementById("two").innerHTML = val;
document.all["two"].value = document.all["one"].value;
}
</script>
</html>