Jump to content

changing the code triggered by the onmouseout event


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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...