Making a Table Row clickable

前端 未结 14 1069
悲&欢浪女
悲&欢浪女 2020-12-24 12:49

I wonder what the best way to make an entire tr clickable would be?

The most common (and only?) solution seems to be using JavaScript, by using onclick=\"javascript:

14条回答
  •  情书的邮戳
    2020-12-24 13:26

    "

    The most common (and only?) solution seems to be using JavaScript, by using onclick="javascript:document.location.href('bla.htm');" (not to forget: Setting a proper cursor with onmouseover/onmouseout).

    "

    The onclick-command should look like this:

    onclick="window.location.href='bla.html';"
    

    And it isn't necessary to do anything onmouseover/-out about the cursor as a cursor-property only works when the mouse is hovering the element:

    style="cursor:pointer;"
    

提交回复
热议问题