一个动态创建div导致js无故失效的问题 本帖最后由 xjl756425616 于 2011-10-14 21:17:16 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你可以 createElement后再给DIV绑定方法 。 呵呵 楼主那个onclick构造没写对<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf8" /><title>无标题文档</title></head></style><body><script type="text/javascript">function abc(){ alert(1)}function create(){ var div = document.createElement("div") div.innerHTML='<span onclick="abc()">我是span,点我<span>'; document.body.appendChild(div)}create()</script></body></html> js option 怎么设置不了 使用extjs做了一个弹出层,想在层中加个grid,怎么加才能显示出来 正则表达式中缺少')' 导出的Excel页调用方法!!!! 这个链接该怎么写? 请问在text下方显示list的东东怎么做的 javascript中如何给二维数组赋值? 框架与超连接的问题 再次高分提问:IE浏览窗口传参数问题!高手进! 有什么办法让用户下载服务器上的文件呢?FTP除外?必给分! if else简写如果没有else后续操作怎么写? 为什么在onclick下获取不了i?是闭包问题吗?
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
<title>无标题文档</title></head>
</style><body>
<script type="text/javascript">function abc()
{
alert(1)
}
function create(){
var div = document.createElement("div")
div.innerHTML='<span onclick="abc()">我是span,点我<span>';
document.body.appendChild(div)
}
create()
</script>
</body>
</html>