SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
Thread: onmouseover highlighting of text
-
Jun 11, 2005, 03:21 #1
- Join Date
- May 2005
- Posts
- 209
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
onmouseover highlighting of text
this is how i call th function hoverIt:
PHP Code:print "<input id= 'hover' onmouseover = hoverIt(1); onmouseout = "hoverIt(0);" type=submit name=\"linksub\" size=\"2\" value=\"ADMINISTRATORS CLICK HERE\" style={border=0;text-decoration:none;color:blue;background-color:grey;cursor:hand;} onClick='document.form.submit() ;'>";
<SCRIPT language="JavaScript">
function hoverIt(state)
{
el = document.getElementById('hover');
el.style.background = (state ==1) ? 'cyan': 'grey';
}
</SCRIPT>
plz. at any cost tell me the mistake...
as soon as i position the mouse on the text and then move it out i get the following runtime error:
line 8:
error:invalid argument
line 8 is:
el = document.getElementById('hover');
note that error occurs when i move the mouse out from the text
plz. at any cost tell me the mistake...i m in real agony....
-
Jun 11, 2005, 13:17 #2
- Join Date
- Aug 2004
- Location
- Manchester UK
- Posts
- 13,807
- Mentioned
- 158 Post(s)
- Tagged
- 3 Thread(s)
This is probably better off in the javascript forum my friend!
SpikeZMike Swiffin - Community Team Advisor
Only a woman can read between the lines of a one word answer.....
Bookmarks