$(function(){
$("#sidebar a").each(function(index, element) {
$(this).attr('href',$(this).attr('href')+"&type=" + index);
});
})
$("#sidebar a").each(function(index, element) {
$(this).attr('href',$(this).attr('href')+"&type=" + index);
});
})
调试欢乐多
document.getElementById("sidebar").getElementsByTagName("li")[num].className = "on"
这句呢
var num=1;
$('#sidebar li').eq(num)[0].className='on';//设置第二个li className为on