<br><br><div><span class="gmail_quote">On 6/4/07, <b class="gmail_sendername">Peter Brunone</b> &lt;<a href="mailto:peter@brunone.com">peter@brunone.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
A couple of things come to mind.&nbsp; First, IIRC, the spec actually says you should *not* use a number for the ID attribute.<br><br>Second, according to your HTML below, the onmouseover event handler should never fire because it&#39;s stuck to the attribute before it (and technically the name of the event should be in all lowercase).
<br><br>However, neither of these is likely to cause the consistent behavior you&#39;ve described.&nbsp; Can you show us a sample of the HTML where you&#39;re using a string as the id?&nbsp; I would guess it has to do with the fact that your event handler code should have quotes around it just like any other HTML attribute, and you&#39;re not switching quote types (
i.e. single to double) when delimiting the ID parameter.&nbsp; If you *don&#39;t* use quotes around the parameter, then the JS parser will think you&#39;re referring to a variable named hint4, which of course does not exist.<br>
<br>In short, this would be right:<br><br>&lt;a href=&quot;#&quot; onmouseover =&quot;toggle_visibility(&#39;hint4&#39;)&quot;&gt;<span class="q"><br>&lt;img src=&quot;../../image/icon_toggle.jpg&quot; width=&quot;22&quot; height=&quot;22&quot; 
<br>border=&quot;0&quot;&gt;&lt;/a&gt;<br></span>&lt;span class = &quot;hidden_hint&quot; id=&quot;hint4&quot;&gt;<span class="q"><br>Add -&lt;img src=&quot;../images/sq_root_7.gif&quot; align=&quot;absmiddle&quot;&gt; to both sides
<br>of the equation.<br>&lt;/span&gt;<br><br></span>Does that help?<br><br>Cheers,<br><br>Peter<br><br><font face="Tahoma, Arial, Sans-Serif" size="2"><b>From</b>: &quot;Del Wegener&quot; <a href="mailto:del@delweg.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
del@delweg.com</a><br></font><div><span class="e" id="q_112f9fa06d2a5175_5"><br><span>Good Day;<br><br>This is the JavaScript function<br>function toggle_visibility(id)<br>{<br>var e = document.getElementById(id);<br>if(e.style.visibility
 != &#39;visible&#39;)<br>e.style.visibility = &#39;visible&#39;;<br>else<br>e.style.visibility = &#39;hidden&#39;;<br>}<br><br>This is the HTML which does the calling<br>&lt;a href=&quot;#&quot;onMouseOver = toggle_visibility(104)&gt;
<br>&lt;img src=&quot;../../image/icon_toggle.jpg&quot; width=&quot;22&quot; height=&quot;22&quot; <br>border=&quot;0&quot;&gt;&lt;/a&gt;<br>&lt;span class = &quot;hidden_hint&quot; id=104&gt;<br>Add -&lt;img src=&quot;../images/sq_root_7.gif&quot; align=&quot;absmiddle&quot;&gt; to both sides
<br>of the equation.<br>&lt;/span&gt;<br><br>This works fine when I use a number for the id.<br>However I would prefer(reasons involve the rest of the page) to use &quot;hint4&quot; <br>for the ID<br>When I use hint4 with or without quotes, the whole toggle fails.
<br>An ALERT inserted in the function returns object for id when I use hint4<br>and returns the number when I use a number.<br><br>I do not understand.<br>Can someone explain what goes wrong when I use id = hint4 ?<br><br>
Thanks for any help.<br><br>Del</span>
</span></div><br>_______________________________________________<br>Javascript mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Javascript@LaTech.edu">Javascript@LaTech.edu</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.LaTech.edu/mailman/listinfo/javascript" target="_blank">
https://lists.LaTech.edu/mailman/listinfo/javascript</a><br><br></blockquote></div><br>Validate your html first, then fix the errors....you don&#39;t have a valid ID, you also aren&#39;t quoting properly...those were just a few, I could probably find a few more things.
<br><br clear="all"><br>-- <br>Anthony Ettinger<br>Ph: 408-656-2473<br>var (bonita, farley) = new Dog;<br>farley.barks(&quot;very loud&quot;);<br>bonita.barks(&quot;at strangers&quot;);<br><br><a href="http://chovy.dyndns.org/resume.html">
http://chovy.dyndns.org/resume.html</a><br><a href="http://utuxia.com/consulting">http://utuxia.com/consulting</a>