换一种思路 考虑文本框onchange事件失效的BUG
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script type="text/javascript">
window.onload = function(){
var obj = document.getElementById("test");
obj.attachEvent("onpropertychange",test);
}
function test(){
if (window.event.propertyName == 'value') {
alert(0);
}
}
</script>
</head>
<body>
<input type="text" name="test" id="test" />
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script type="text/javascript">
window.onload = function(){
var obj = document.getElementById("test");
obj.attachEvent("onpropertychange",test);
}
function test(){
if (window.event.propertyName == 'value') {
alert(0);
}
}
</script>
</head>
<body>
<input type="text" name="test" id="test" />
</body>
</html>