HTML table row link

后端 未结 6 1867
自闭症患者
自闭症患者 2020-12-14 04:14

What is the best way to make a row of an HTML table a link? I currently am using jquery to zebra stripe the rows and also to highlight the onmouseover/off selected row, so

6条回答
  •  离开以前
    2020-12-14 04:48

    $(document).ready(function(){
       $("tr").click(function(){
          /* personally I would throw a url attribute () on the tr and pull it off on click */
          window.location = $(this).attr("url");
    
       });
    });
    

提交回复
热议问题