Jump to content

Using JS to get label attribute?


grippat

Recommended Posts

I'm using Javascript in XUL (similar to HTML or any other XML) and one of the attributes for a tag is "label". Specifically I'm using this attribute on a "menu" tag. Here's what the DOM is like for the section I'm having trouble with:

<menubar>   <menu label="stuff">      <menupopup>         <menuitem label="more stuff" onclick="alert(this.label); alert(this.parentNode.parentNode.label)"/>

Now here's my problem: the second alert in the onclick always says it's undefined even though the first alert always displays the correct label ("more stuff"). Why would it give me back an undefined for the second?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...