<script type="text/javascript">
function testdemo(){
var element = document.getElementById("myname");
if("/v"=="v") {
element.onpropertychange = textChange;
}else{
element.addEventListener("input",textChange,false);
}
function textChange(){
document.getElementById("tno").innerHTML=element.value;
}
}
</script>
<body>
<input type="text" name="myname" Width="500px" height="900px" maxlength="2000" value="123" id="myname" />
<SPAN style="COLOR: red" id="tno"></SPAN>
<script type="text/javascript">
testdemo();
</script>
js监听
最新推荐文章于 2024-02-20 10:53:18 发布