Click to See Complete Forum and Search --> : On Mouse Over


feras_wilson
10-08-2005, 10:57 AM
Hi!
Why this dont work??



<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Ny sida 1</title>
<script>
function onmm() {
thefield.onmouseover="thefield.style.backgroundColor='#ffff00'"

}
</script>
</head>
<body>

<table border="1" width="100%" id="table1">
<tr>
<td id="thefield">The Field</td>
<td>&nbsp;</td>
</tr>
</table>
<a href="#" onclick="onmm()">Change OnMouseOver</a>
</body>

</html>

Please Help

Nedals
10-08-2005, 11:12 AM
Which is it, onclick OR onmouseover?


function onmm() {
document.getElementById('thefield').style.backgroundColor='#ffff00';
}

...
<td id="thefield" onmouseover="onmm()">The Field</td>

jam
10-08-2005, 11:15 AM
or cant u use

function onm(){
document.all.theField.style.backgroundColor='#ffff00';
}
.......
<td id="theField" onmouseover="onmm()">The Field</td>

Nedals
10-08-2005, 12:07 PM
or cant u use

function onm(){
document.all.theField.style.backgroundColor='#ffff00';
}
.......
<td id="theField" onmouseover="onmm()">The Field</td>
If you only want it to work in IE.