标签:
<input type="text" name="textfield" id="text_input" /> <div>您输入的值为:<span id="test">还未输入</span></div>
<script type="text/javascript"> function immediately(){ var element = document.getElementById("text_input"); if("\v"=="v") { //IE 6 7 8 element.onpropertychange = webChange; }else{ element.addEventListener("input",webChange,false); } function webChange(){ if(element.value){document.getElementById("test").innerHTML = element.value}; } } immediately(); </script>
标签:
原文地址:http://www.cnblogs.com/heqhbk/p/4267300.html