<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body>Helo Del,<BR>
this code works&nbsp;as expected&nbsp;on both, IE and FX (strictmode): <BR>
&nbsp;<BR>
&lt;a href="#" onMouseOver = toggle_visibility('hint4')&gt;<BR>&lt;img src="../../image/icon_toggle.jpg" width="22" height="22" border="0"&gt;&lt;/a&gt;<BR>
&lt;span class = "hidden_hint" id=hint4&gt;<BR>&nbsp;Add -<BR>&nbsp;&lt;img src="../images/sq_root_7.gif" align="absmiddle"&gt;<BR>&nbsp;to both sidesof the equation.<BR>&lt;/span&gt;<BR>
&nbsp;<BR>
function toggle_visibility(id) {<BR>&nbsp; var e = document.getElementById(id);<BR>
&nbsp; if(e.style.visibility != 'visible')<BR>&nbsp;&nbsp; e.style.visibility = 'visible';<BR>&nbsp; else<BR>&nbsp;&nbsp; e.style.visibility = 'hidden'; <BR>} <BR>
&nbsp;<BR>
One thing I don't understand is what's the use of a toggle function if<BR>
there is no "onmouseout" event defined? Since you'll have to mouseover<BR>
twice to toggle it, consider defining the mouseout also:<BR><BR>
&lt;a href="#"onMouseOver = toggle_visibility('hint4') <BR>
onMouseOut = toggle_visibility('hint4')&gt;<BR>
...<BR><BR>
Regards<BR>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Troy III <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; progressive art enterprise<BR>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<BR><BR><BR><BR>
<HR id=stopSpelling>
<BR>
&gt; From: del@delweg.com<BR>&gt; To: javascript@LaTech.edu<BR>&gt; Date: Mon, 4 Jun 2007 22:13:51 -0500<BR>&gt; Subject: [Javascript] Trouble with id<BR>&gt; <BR>&gt; Good Day;<BR>&gt; <BR>&gt; This is the JavaScript function<BR>&gt; function toggle_visibility(id)<BR>&gt; {<BR>&gt; var e = document.getElementById(id);<BR>&gt; if(e.style.visibility != 'visible')<BR>&gt; e.style.visibility = 'visible';<BR>&gt; else<BR>&gt; e.style.visibility = 'hidden';<BR>&gt; }<BR>&gt; <BR>&gt; This is the HTML which does the calling<BR>&gt; &lt;a href="#" onMouseOver = toggle_visibility(104)&gt;<BR>&gt; &lt;img src="../../image/icon_toggle.jpg" width="22" height="22" <BR>&gt; border="0"&gt;&lt;/a&gt;<BR>&gt; &lt;span class = "hidden_hint" id=104&gt;<BR>&gt; Add -&lt;img src="../images/sq_root_7.gif" align="absmiddle"&gt; to both sides<BR>&gt; of the equation.<BR>&gt; &lt;/span&gt;<BR>&gt; <BR>&gt; This works fine when I use a number for the id.<BR>&gt; However I would prefer(reasons involve the rest of the page) to use "hint4" <BR>&gt; for the ID<BR>&gt; When I use hint4 with or without quotes, the whole toggle fails.<BR>&gt; An ALERT inserted in the function returns object for id when I use hint4<BR>&gt; and returns the number when I use a number.<BR>&gt; <BR>&gt; I do not understand.<BR>&gt; Can someone explain what goes wrong when I use id = hint4 ?<BR>&gt; <BR>&gt; Thanks for any help.<BR>&gt; <BR>&gt; Del<BR>&gt; <BR>&gt; <BR>&gt; _______________________________________________<BR>&gt; Javascript mailing list<BR>&gt; Javascript@LaTech.edu<BR>&gt; https://lists.LaTech.edu/mailman/listinfo/javascript<BR><BR><br /><hr />Play free games, earn tickets, get cool prizes! Join Live Search Club.   <a href='http://club.live.com/home.aspx?icid=CLUB_wlmailtextlink' target='_new'>Join Live Search Club!</a></body>
</html>