I’m pretty sure I’ve mucked something up but need a second set of eyes to spot it for me right now. Been staring at it too long.
I’m trying to create a right-click context menu. I feel that I’m very close, but every time I try to get the menu object I get null. In fact, I am unable to get any element if I change the id string. I do get the alert though, so I know I’m at least running that line.
Here’s the javascript I’m using:
[CODE]
if (isValidIE || isValidNetscape)
{
var menuobj = document.getElementById( “myId” );
if ( null == menuobj )
{
alert(“menu obj is null”);
}
}
And here’s my html for the menu, in case it’s usefull:
[CODE]
<div id=’myId’ class=’skin0′ onMouseover=’highlight(event);’ display:none>
<div class=”menuitems”>Show all records</div>
<div class=”menuitems”>Sort hits</div>
<div class=”menuitems”>Multi-sort hits</div>
<div class=”menuitems”>Query</div>
<div class=”menuitems”>Query hits</div>
</div>
Any ideas?
Thanks,
em