初学者请教!!!
<html>
<head>
<script><title>I'll go and quit my job in the freedom company!! </title>
function ss()
{
alert(document.Form1.dd.value);
}
</script>
</head>
<body>
<form id="Form1" method="post">
<input type="text" id="dd" onblur="ss()">
</form>
</body>
</html>
报alert(document.Form1.dd.value);这个有错
哪位帮我解决一下
[解决办法]
为什么不直接
alert(document.getElementById("dd").value);
[解决办法]
表单操作是用name而不是id的,只是ie能兼容两者所以很多时大家都忽略了。把form、input、textarea等的id都改为name是最好的。又或者用比较正道的操作方法如1楼的,又或者是document.forms[xxx].elements[xxxx].value