DHTML Text replaces Image on Mouseover

[Total: 0    Average: 0/5]

This uses DHTML to replace a picture with HTML on a mouseover event.

Head Code:

<style>
.S1 {color: red; background-color: #AACCFF; border-style: solid; border-color: orange; border-width: 3px;}
</style>

Body Code:

<table border=1 align=center>
<tr><td align=center valign=middle height=150 width=150><span id=mine><a href="javascript:void(0);" onmouseover="doThis()"><img src="http://www.js-x.com/js/pic1.gif" border=0 height=50 width=50></a></span></td></tr>
</table>
<script>
var _NEW="<table border=1><tr><td>HI</td><td rowspan=2>THERE</td></tr><tr><td> Look over</td></tr></table>";
function doThis()
{
  document.getElementById("mine").innerHTML=_NEW;
  document.getElementById("mine").className="S1";
}
</script>

Times Viewed: 8

Leave a Reply

Your email address will not be published. Required fields are marked *