document.getElementById("menuJobList");
--->
document.all("menuJobList");呢
解决方案 »
- 怎样在window.open()返回结果后做操作
- action如何打开新的页面显示数据
- 请问怎么访问框架里面的页面的js函数?
- 关于getAttribute
- 关于JS图片轮播的问题
- 请问meizz:"梅花雨日历控件2.02版"可不可以在IE以外的浏览器的?
- javascript如何获得服务器的地址
- Jquery用json调用wcf服务的问题
- 有个比较奇怪的问题,checkbox的checked="cheecked"属性已添加,但是前边却没有后打钩
- IE 6 下无法在不提示的情况下直接关闭当前窗口了吧?
- 怎样显示模式对话框
- 下拉列表与输入文本框联动问题,单选按钮与行或列联动问题,单选按钮与下拉列表框连动问题(在线等待)
用document.tablename.trname.menuJobList呢/
<td id="menuJobList" class="menu-item" width="160" onclick="this.style.backgroundColor='red'">
document.all document.elementName等好像都是MS扩展的,只适用于IE。hahacc(出師無名) 提的建议,我曾经用过,但和最终的效果还有点差距,
因为我想实现
a.在用户选中某菜单后,即使鼠标移开,其背景色也是选中时的背景色,
b.在点击其他菜单时,刚才被选中的菜单的背景色恢复为初始颜色。
hahacc的建议只能实现a,对于b好像只能通过javascript访问页面元素实现。sigh!~
var justnow="";
function reset()
{
if(justnow!="")
eval("document.all."+justnow+".style.backgroundColor='white'")
}
</script><td id="menuJobList" class="menu-item" width="160" onmousedown="reset();this.style.backgroundColor='red';justnow=this.id;">
可能是因为它不支持document.all
我沒看清楚!現在知道是怎樣的效果了!但我沒在netscape4.X下實驗,弄個你想要的效果,在IE下是可以的.在netscape4.X下不知道行不行!
以下是整個頁面的全部代碼:
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<title>新增網頁1</title>
<STYLE type=text/css>
.high { background-color: #006699; color: #FFFFFF; cursor: default}
.target { color: #FFFFFF; background-color: #006699; border: 2px #CCCCCC solid}
</STYLE>
<script language="JavaScript">
function high(ob){
ob.className=(ob.className=='target')?'target':'high';
}function low(ob){
ob.className=(ob.className=='target')?'target':'';
}function setTarget(){
for (i=1;i<=3;i++){
eval('e'+i).className='';
}
event.srcElement.className='target';
}
</script>
</head><body>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="100%" onMouseOver=high(this) onMouseOut=low(this) onClick=setTarget() id=e1> </td>
</tr>
<tr>
<td width="100%" onMouseOver=high(this) onMouseOut=low(this) onClick=setTarget() id=e2> </td>
</tr>
<tr>
<td width="100%" onMouseOver=high(this) onMouseOut=low(this) onClick=setTarget() id=e3> </td>
</tr>
</table>
</body>
</html>
学习,关注!帮你顶一下