<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
</head>
<body>
<input id="input" onchange="handcnange(this);" type="text" />
<span id="span"></span>
<script type="text/javascript">
// 补全代码
function handcnange(obj){
document.getElementById('span').innerHTML=obj.value
}
</script>
</body>
</html>
<html>
<head>
<meta charset=utf-8>
</head>
<body>
<input id="input" onchange="handcnange(this);" type="text" />
<span id="span"></span>
<script type="text/javascript">
// 补全代码
function handcnange(obj){
document.getElementById('span').innerHTML=obj.value
}
</script>
</body>
</html>