日期:2014-05-17 浏览次数:20902 次
<script type="text/javascript" src="js/jquery-1.3.2.js"></script> <style> .t1{background:red} </style> <script> var cur; window.onload=function(){ $("li").click(function(){ if(cur == $(this)[0]) return false; if(cur!=null) cur.className = ""; $(this)[0].className = "t1"; cur = $(this)[0]; }) } </script> <ul> <li>aaaaa </li> <li>bbb </li> <li>ccc </li> </ul>