Making a Table Row clickable

前端 未结 14 989
悲&欢浪女
悲&欢浪女 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:24

    If you're already relying on javascript for the click, then you can also use javascript to show the url in status area, change the cursor, or do other things so it looks more like a link. Of course, the browser may ignore the code that sets the status area.

    0 讨论(0)
  • 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;"
    
    0 讨论(0)
提交回复
热议问题