JSFiddle - React, Tailwind, and code Playground
by Rahul Sharma
HTML
<table id="t">
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>row number
<input type="text" id="row" />col number
<input type="text" id="col" />
<input type="button" value="color me " id="b" />
CSS
table {
width:500px;
}
table td {
border:solid 1px black;
}
JavaScript
$(document).ready(function () {
$('#b').click(function () {
alert('HI');
var row = $('#row').val();
var col = $('#col').val();
alert(row);
alert(col);
$('#t tr:eq('+row+') td:eq('+col+')').css('backgroundColor', '#000');
});
});