JSFiddle - React, Tailwind, and code Playground
HTML
<form type="POST" onSubmit="change()">
<table>
<tr>
<td id="a1">This</td>
<td id="a2"><input type="text" id="t1"/> </td>
</tr>
</table>
<input type="submit" value="submit"/>
</form>
JavaScript
function change()
{
document.getElementById("op").innerHTML="this works!";
prompt(document.getElementById("op").innerHTML);
}