the point was to get focus on a particular element of a webpage on mouse move by changing the background color of the element.
The html is as follows:
<html>
<head>
<base src="..... />
<script>....</script>
<link..../>
<title></title>
</head>
<body>
<p style="font-size:20px;font-weight:bold"> Enter values or choose options
in the form below .</p>
<div id="d1">
<form id="f1" action="" method="post">
<fieldset>
<legend><a name="pdet"></a>Personal Details</legend>
<table id="t1" width="400" height="auto" rows="4" cols="2">
<tr id="tr1" onMouseMove ="focus(tr1)" onMouseOut ="original(tr1)">
<td><label for="fname">First Name :<label></td>
<td><input type="text" id="fname" col="30"></input></td>
</tr>
<tr id="tr2" onMouseMove ="focus(tr2)" onMouseOut ="original(tr2)">
<td><label for="lname">Last Name : </label></td>
<td><input type="text" id="lname" col="30"></input></td>
</tr>
</table>
</fieldset>
</form>
</div>
<br/>
</body>
</html>
The javascript functions are as follows
function focus(e_id){
var element = document.getElementById("e_id").style.backgroundColor ="blue";
}
function original(e_id){
var element = document.getElementById("e_id").style.backgroundColor="green";
}
Read the previous ans on the same topic where it was suggested to do so by using 'focus(this)' or 'focus(this.id)' as arguments to pass the element itself or the id of the element respectively. Tried it but it did not work.
can anyone help me resolve this?