为你的tr都加上id,分别为id="tr1",id="tr2",id="tr3",。。。。。。,同时把所有tr都隐藏,display="none"在window.onload中,document.getElementById("tr"+$id).style.display="";