日期:2014-05-16 浏览次数:20314 次
<div class="active" id="sidebar">
<li class="list-none navnow"> <a href='News.aspx?id=1' title='公司动态' ><span>公司动态</span></a></li>
<li class="list-none navnow"> <a href='News.aspx?id=2' title='业界资讯' ><span>业界资讯</span></a></li>
</div>
var links =document.getElementById("sidebar").getElementsByTagName("a");
for(var i = 0, j = links.length; i < j; i++)
{
links[i].href = links[i].href + "&type=" + i;
}
$(function(){
$("#sidebar a").each(function(index, element) {
$(this).attr('href',$(this).attr('href')+"&type=" + index);
});
})