JSFiddle - React, Tailwind, and code Playground

by asif097

HTML

<table>
    <tbody>
        <tr data-url="http://google.com/">
            <td>Google.com</td>
        </tr>
        <tr data-url="http://slashdot.org/">
            <td>slashdot.org</td>
        </tr>
    </tbody>
</table>

JavaScript

var rows = document.getElementsByTagName('tr'),
                uri;

            for (var i = 0, len = rows.length; i < len; i++) {
                rows[i].onclick = function () {
                    uri = this.getAttribute('data-url');
                    window.location = uri;
                };
            }