<table>
<tr>
<td>one</td>
<td>two</td>
</tr>
<tr>
<td>three</td>
<td>four</td>
</tr>
</table>
<div id="numbers">
<iframe name="letters" src="">
</iframe>
</div>
I'd like to have the ability to click on any cell in the table, grab the value inside, show the div and append the iframe src based on the cell's value. When the user clicks on the cell again the iframe becomes blank and the div is hidden.
For example: click cell one, show the div with the iframe src="/one.html". Click it again, hide the div with a blank iframe.
Thanks in advance!
(Please, no jQuery answers.)
document.querySelector('iframe').src='http://y-u-no-search.internet';