js点击改变class的值
00:50 | Author: Hui Li 李辉

<style type="text/css">
<!--
.nav_title
{ background-color:#FFFF00}
.nav_title_onclick
{ background-color:#00FF00}

-->
</style><ul>
<li class="nav_title" onclick="g(this)">文章管理1 </li>
<li> <a href="#">添加文章 </a> </li>
<li> <a href="#">添加文章 </a> </li>
<li class="nav_title">产品管理 </li>
<li> <a href="#">添加文章 </a> </li>
<li> <a href="#">添加文章 </a> </li>
<li class="nav_title">产品管理 </li>
<li> <a href="#">添加文章 </a> </li>
<li> <a href="#">添加文章 </a> </li>
</ul>

<script>
function g(e){
e.className
=(e.className=="nav_title"?"nav_title_onclick":"nav_title")
}
</script>

This entry was posted on 00:50 and is filed under . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

0 评论: