document.getElementById("tt").parentElement.appendChild(span);//
解决方案 »
- 怎样判断输入的日期是不是一个月的?
- 【推荐】Google URL Shortener推出啦~
- 求一个javascipt读写XML的例子?????????????????????
- 如何实现鼠标移到文本框上,本文内容全选,移出时取消选择
- 我想用javascript做一个效果,不知怎么做。
- 请问高手如何让我选择下拉列表1的值后,能够影响到另一个下拉列表的值
- 帮帮我,
- 请问style.pixeLeft和style.Left分别是什么,他们之间有什么区别?
- 拒绝访问错误是怎么回事?
- 问个小问题,能否自动的使iframe的scroll出现
- 求救
- !!!!!!请问在JAVASCRIPT中是否有办法判断字符的全角和半角.望高手指点!!!!!!
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<script language="javascript" defer>
var span = document.createElement("SPAN");
span.id = "__ErrorMessagePanel";
span.style.color ="red";
document.getElementById("dd").appendChild(span);//这句出错了!!!
span.innerHTML = "* 旧密码不正确";
</script>
<body>
<table width="500" height="36" border="0" cellpadding="0" cellspacing="0">
<tr id="pp">
<td id="dd"><input name="tt" type="text" id="tt" />
</td>
</tr>
</table>
</body>
</html>
</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<SCRIPT FOR=window EVENT=onload LANGUAGE="JavaScript">
var span = document.createElement("SPAN");
span.id = "__ErrorMessagePanel";
span.style.color ="red";
document.getElementById("tt").parentElement.appendChild(span);//这句出错了!!!
span.innerHTML = "* 旧密码不正确";
</script>
<body>
<table width="500" height="36" border="0" cellpadding="0" cellspacing="0">
<tr id="pp">
<td id="dd"><input name="tt" type="text" id="tt" />
</td>
</tr>
</table>
</body>
</html>测试后ok ie6下
window.onload事件中,也就是页面加载完毕的时候,而用你的代码,还没执行到tt对象的时候,你就调他,当然找不到了