Make table row clickable

前端 未结 4 628
Happy的楠姐
Happy的楠姐 2021-01-15 19:22

I have a table row that has background color on hover. When user clicks within the background color area, it should grab the link of the anchor tag inside the row and take t

4条回答
  •  Happy的楠姐
    2021-01-15 19:57

    you need to also remove space between tr and #ClickableRow other wise it will take as children element.

    $('tr#ClickableRow').click(function () {
        window.location = $(this).find('a').attr("href");
    });
    

提交回复
热议问题