<div id="productSwitcher" onclick="mm(this, event)">
<a id="list1" class="ontime" href="#">首 页 </a>
<a id="list2" href="#">采购管理</a>
<a id="list3" href="#">销售管理</a>
<a id="list4" href="#">库存管理</a>
<a id="list5" href="#">财务管理</a>
<a id="list6" href="#">系统管理</a>
<div style="clear:both;"></div>
</div>
<SCRIPT LANGUAGE="JavaScript">
<!--
function mm(div, e)
{
e = window.event||e;
e = e.srcElement || e.target;
if(e.tagName=="A")
{
var a = div.childNodes;
for(var i=0; i<a.length; i++)
{
if(a[i].nodeType==1) a[i].className="";
}
e.className="ontime"
}
}
//-->
</SCRIPT>
<a id="list1" class="ontime" href="#">首 页 </a>
<a id="list2" href="#">采购管理</a>
<a id="list3" href="#">销售管理</a>
<a id="list4" href="#">库存管理</a>
<a id="list5" href="#">财务管理</a>
<a id="list6" href="#">系统管理</a>
<div style="clear:both;"></div>
</div>
<SCRIPT LANGUAGE="JavaScript">
<!--
function mm(div, e)
{
e = window.event||e;
e = e.srcElement || e.target;
if(e.tagName=="A")
{
var a = div.childNodes;
for(var i=0; i<a.length; i++)
{
if(a[i].nodeType==1) a[i].className="";
}
e.className="ontime"
}
}
//-->
</SCRIPT>
.myColor{color:yellow;}
</style>
<a id="list2" href="#" onclick="this.className='myColor'">采购管理</a>
试了一下,查看源文件的时候,没有看到有加进入class="ontime"
document.getElementByid('list2').class= 'ontime';其它依次类推!
.ontime{font-size: 14px; font-weight: bold}
</style><div id="productSwitcher" onclick="mm(this, event)">
<a id="list1" class="ontime" href="#">首 页 </a>
<a id="list2" href="#">采购管理</a>
<a id="list3" href="#">销售管理</a>
<a id="list4" href="#">库存管理</a>
<a id="list5" href="#">财务管理</a>
<a id="list6" href="#">系统管理</a>
<div style="clear:both;"></div>
</div>
<SCRIPT LANGUAGE="JavaScript">
<!--
function mm(div, e)
{
e = window.event||e;
e = e.srcElement || e.target;
if(e.tagName=="A")
{
var a = div.childNodes;
for(var i=0; i<a.length; i++)
{
if(a[i].nodeType==1) a[i].className="";
}
e.className="ontime"
}
}
//-->
</SCRIPT>