当调用这个函数时,
function yangshi(a)
{
eval(a).style.color="#000";
eval(a).style.backGround="#50AEEE";
}
提示"a1"未定义,但是在页面中有这个东西呀!
<li><a id="a1" class="hide" href="b.asp">职位管理</a>
<!--[if lte IE 6]>
<a href="#">职位管理
<table><tr><td>
<![endif]-->
<ul>
<li><a href="#">第二级21</a></li>
<li><a href="#">第二级22</a></li>
<li><a href="#">第二级23</a></li>
<li><a href="#">第二级24</a></li>
</ul>
<!--[if lte IE 6]>
</td></tr></table>
</a>
<![endif]-->
</li> 谁来帮我看看
function yangshi(a)
{
eval(a).style.color="#000";
eval(a).style.backGround="#50AEEE";
}
提示"a1"未定义,但是在页面中有这个东西呀!
<li><a id="a1" class="hide" href="b.asp">职位管理</a>
<!--[if lte IE 6]>
<a href="#">职位管理
<table><tr><td>
<![endif]-->
<ul>
<li><a href="#">第二级21</a></li>
<li><a href="#">第二级22</a></li>
<li><a href="#">第二级23</a></li>
<li><a href="#">第二级24</a></li>
</ul>
<!--[if lte IE 6]>
</td></tr></table>
</a>
<![endif]-->
</li> 谁来帮我看看
另外 eval(a).style.backgroundColor="#50AEEE";
var obj = document.getElementById(a);
obj.style.backgroundColor="#50AEEE";
或者obj.currentStyle.backgroundColor="#50AEEE";