js创建对象后如何加载事件? 我只知道divobject.onclick=function(){xxxxxxxxxxxx}divobject.attachEvent("onclick",function(){xxxxxxxxxxxxxxx}) 解决方案 » 免费领取超大流量手机卡,每月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="Gao YiXiang" /> <meta name="email" content="[email protected]" /> <meta name="keywords" content="javascript dhtml dom" /> <meta name="description" content="I love web development." /></head><body> <div id="divTest" style="width: 100px; height: 100px; background-color: blue"> </div> <script type="text/javascript"> <!--var oDiv = document.getElementById("divTest");oDiv.onclick = showBgColor;function showBgColor(oTarget){ if (oTarget == undefined) { oTarget = this; } alert(oTarget.style.backgroundColor);} //--> </script></body></html> 送你三本手册!DHTML参考手册http://download.csdn.net/source/308913样式表中文手册http://download.csdn.net/source/304124JScript语言参考http://download.csdn.net/source/308916 jquery tabs 默认选择,官网例子,就是不行,疯了。 jsp中如何调用JS里的方法并显示? 求教 Ext4.0 树形过滤怎样实现 javascript 如何在模式对话框内,点击一个按钮,可以改变模式对话框的页面大小?急!!! 请问javascript如何控制div的位置? textarea 问题 javascript中如何获得参数的值? 用什么函数判断一个字符传中包含另一个字符串?谢谢! js 用什么方法能生成如下电商商品属性表格 如何获取用户浏览器安装了那些插件? 求个正则,在线等。解决马上给分
<!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="Gao YiXiang" />
<meta name="email" content="[email protected]" />
<meta name="keywords" content="javascript dhtml dom" />
<meta name="description" content="I love web development." />
</head>
<body>
<div id="divTest" style="width: 100px; height: 100px; background-color: blue">
</div>
<script type="text/javascript">
<!--
var oDiv = document.getElementById("divTest");oDiv.onclick = showBgColor;function showBgColor(oTarget)
{
if (oTarget == undefined)
{
oTarget = this;
}
alert(oTarget.style.backgroundColor);
}
//-->
</script>
</body>
</html>
http://download.csdn.net/source/308913样式表中文手册
http://download.csdn.net/source/304124JScript语言参考
http://download.csdn.net/source/308916