Answers for "click on tr redirect new page"

0

click on tr redirect new page

<table class="table">
    <tbody>
        <tr data-url="some_url1">
            <td>39401602</td>
            <td>6/21/2013</td>
            <td class="text-primary">Open</td>
            <td>$79.99</td>
            <td>Amazing Widget (16 GB, White)</td>
            <td>Johnathan Doe</td>
            <td class="text-right none"> <a href="#" class="tick_icon gridneed_icon"></a>
    <a class="col-md-offset-1 cross_icon gridneed_icon" data-toggle="modal" href="#deleteproduct"></a>

            </td>
        </tr>
        <tr data-url="some_url2">
            <td>39401602</td>
            <td>6/21/2013</td>
            <td class="text-primary">Open</td>
            <td>$79.99</td>
            <td>Amazing Widget (16 GB, White)</td>
            <td>Johnathan Doe</td>
            <td class="text-right none"> <a href="#" class="tick_icon gridneed_icon"></a>
    <a class="col-md-offset-1 cross_icon gridneed_icon" data-toggle="modal" href="#deleteproduct"></a>

            </td>
        </tr>
    </tbody>
</table>
Posted by: Guest on June-02-2020
0

click on tr redirect new page

$(function () {
    $('table.table tr').click(function () {
        window.location.href = $(this).data('url');
    });
})
Posted by: Guest on June-02-2020

Code answers related to "click on tr redirect new page"

Browse Popular Code Answers by Language