JSFiddle - React, Tailwind, and code Playground

by superiorbanana

HTML

<body>
    <button name="start">Click me before clicking cells</button>
    <table>
        <tr>
            <td>1</td>
            <td>2</td>
        </tr>
    </table>
</body>

CSS

td {
    font-family: calibri;
    font-size: 12px;
    width: 15px;
    height: 15px;
    border: 1px solid black;
}

.clicked {
    background: yellow;
}

JavaScript

var select = function() {
    /*once called this function should enable clicks on <td>
    toggling its class to yellow and once both cells are yellow
    clicking should be disabled*/
};

$(document).ready(function(){
    $("button[name=start]").click(function(){
        select();
    });
});