Jump to content

changing the code triggered by the onmouseout event


george

Recommended Posts

I want to change the behaviour of the "onmouseout" event when someone clicks the table cell and evokes the javascript code. I want the javascript to modify the code triggered by the onmouseout event. Is that doable? Can I assign a code to an onmouseout event from the code triggered by the on click event?

<table>	<tr>	<td bgcolor='#00FFFF' onmouseout="this.style.background='#00FFFF'" onmouseover="this.style.background='#0099FF';" onclick="standardOn(this);" >using Pounds and Feet</td>	<td> or </td>	<td bgcolor='#00FFFF' onmouseout="this.style.background='#00FFFF'" onmouseover="this.style.background='#0099FF';" onclick="metricOn(this);" >Kilograms and Meters</td>	</tr></table>

The javascript is here:

function standardOn(button) { button.style.background='#0099FF';document.getElementById('metric').style.display='none';document.getElementById('standard').style.display='block';document.getElementById('standard').style.background='#CCCCCC';}function metricOn(button) {button.style.background='#0099FF';document.getElementById('metric').style.display='block';document.getElementById('standard').style.display='none';document.getElementById('metric').style.background='#CCCCCC';}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...