<head></head>
<body>
<ul>
<li class="picrp">
<li class="picrp">
<li class="picrt">
<li class="picrp">
<li class="picrp">
<li class="picrt">
<li class="picrp">
<li class="picrp">
<li class="picrt">
</ul>
<script type="text/javascript">
var target = document.getElementByid("target")
var lis = target.getElementsByTagName('li')
var i_cur
for(var i=0 i<lis.length i++){
i_cur = i%2
if(i_cur<1){
lis[i].className = 'picrp'
}else{
lis[i].className = 'picrt'
}
}
</script>
</body>
</htmL>
比较简单,可以这样来做:<script type="text/javascript">
var u = document.getElementById("about")
var n = document.getElementsByTagName("li")
n[0].className = "ubNav"
</script>