firefox中textbox的OnInput事件问题??? onchange 改变文本后失去焦点后触发onpropertychange 改变文本后立即触发. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 L@_@K<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> new document </title> <meta name="generator" content="editplus" /> <meta name="author" content="" /> <meta name="keywords" content="" /> <meta name="description" content="" /> </head> <body> <input type="text" id="txtInput" /> <input type="hidden" id="hidValue" /> <input type="button" id="btnShow" value="Show Value" /> <script type="text/javascript"> <!--function $(sId) {return document.getElementById(sId);}$("txtInput").onkeydown = function() { $("hidValue").value = this.value;};$("txtInput").onchange = function() { $("hidValue").value = this.value;};$("btnShow").onclick = function() { alert($("hidValue").value);}; //--> </script> </body></html> 我知道这个好用啊,可是我的Textbox中的值是通过document.getElementById(txtId).value=‘AAA;赋上去的,这时就不好用了 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> new document </title> <meta name="generator" content="editplus" /> <meta name="author" content="" /> <meta name="keywords" content="" /> <meta name="description" content="" /> </head> <body> <input type="text" id="txtInput" /> <input type="hidden" id="hidValue" /> <input type="button" id="btnShow" value="Show Value" /> <script type="text/javascript"> <!--function $(sId) {return document.getElementById(sId);}$("txtInput").onkeydown = function() { $("hidValue").value = this.value;};$("txtInput").onchange = function() { $("hidValue").value = this.value; alert($("hidValue").value);};$("btnShow").onclick = function() { $("txtInput").value = "AAAA"; //alert($("hidValue").value);}; //--> </script> </body></html>这是我想要的逻辑,可是现在不好用啊... js 急急急! 如何根据name和value选中radio 谁能反编译这一小短代码,分全送! 一段代码 换行问题 checkbox问题 如何才能把自己的id传到函数中去?select有没有selectchanged事件可以调用 网上电子填图?急!! 如何通过多选框控制大类的搜索嘛? 在线等待:高分奉送,便宜的东东 请高人指点radio,取值 关于iframe的滚动条的问题
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head> <body>
<input type="text" id="txtInput" />
<input type="hidden" id="hidValue" />
<input type="button" id="btnShow" value="Show Value" />
<script type="text/javascript">
<!--
function $(sId) {return document.getElementById(sId);}
$("txtInput").onkeydown = function() {
$("hidValue").value = this.value;
};
$("txtInput").onchange = function() {
$("hidValue").value = this.value;
};
$("btnShow").onclick = function() {
alert($("hidValue").value);
};
//-->
</script>
</body>
</html>
我知道这个好用啊,可是我的Textbox中的值是通过document.getElementById(txtId).value=‘AAA;
赋上去的,这时就不好用了
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head> <body>
<input type="text" id="txtInput" />
<input type="hidden" id="hidValue" />
<input type="button" id="btnShow" value="Show Value" />
<script type="text/javascript">
<!--
function $(sId) {return document.getElementById(sId);}
$("txtInput").onkeydown = function() {
$("hidValue").value = this.value;
};
$("txtInput").onchange = function() {
$("hidValue").value = this.value;
alert($("hidValue").value);
};
$("btnShow").onclick = function() {
$("txtInput").value = "AAAA";
//alert($("hidValue").value);
};
//-->
</script>
</body>
</html>
这是我想要的逻辑,可是现在不好用啊...