<br><br><div><span class="gmail_quote">On 6/4/07, <b class="gmail_sendername">Peter Brunone</b> <<a href="mailto:peter@brunone.com">peter@brunone.com</a>> 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. 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'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've described. Can you show us a sample of the HTML where you're using a string as the id? 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're not switching quote types (
i.e. single to double) when delimiting the ID parameter. If you *don't* use quotes around the parameter, then the JS parser will think you're referring to a variable named hint4, which of course does not exist.<br>
<br>In short, this would be right:<br><br><a href="#" onmouseover ="toggle_visibility('hint4')"><span class="q"><br><img src="../../image/icon_toggle.jpg" width="22" height="22"
<br>border="0"></a><br></span><span class = "hidden_hint" id="hint4"><span class="q"><br>Add -<img src="../images/sq_root_7.gif" align="absmiddle"> to both sides
<br>of the equation.<br></span><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>: "Del Wegener" <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
!= 'visible')<br>e.style.visibility = 'visible';<br>else<br>e.style.visibility = 'hidden';<br>}<br><br>This is the HTML which does the calling<br><a href="#"onMouseOver = toggle_visibility(104)>
<br><img src="../../image/icon_toggle.jpg" width="22" height="22" <br>border="0"></a><br><span class = "hidden_hint" id=104><br>Add -<img src="../images/sq_root_7.gif" align="absmiddle"> to both sides
<br>of the equation.<br></span><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 "hint4" <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't have a valid ID, you also aren'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("very loud");<br>bonita.barks("at strangers");<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>