i have this HTML code, how do i call a javascript function without making changes to my HTML file.
<tr>
<td><div id="number1">1</div></td>
<td><div>+</div></td>
<td><div id="number2">2</div></td>
<td><div>=</div></td>
<td><input type="text"></input></td>
<td><input type="button" value="Check"></input></td>
</tr>
tried to use this javascript code but didn't work
var button = document.getElementsByTagName("input");
button.onclick = function(){ alert('hello!'); };