Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding properties to custom tags

Status
Not open for further replies.

davikokar

Technical User
May 13, 2004
523
IT
Hallo,

in my webpage I have a construct more or less like this:

<xml>
<menuitem class="blabl" id="001" />
<menuitem class="blabl" id="002" />
<menuitem class="blabl" id="003" />
</xml>

The menuitem is not part of the html DOM (I think...), but I was wondering if I can access the menuitem tag by using javascript, and add a property, so that I would have (for example):

<xml>
<menuitem class="blabl" id="001" target="_blank" />
<menuitem class="blabl" id="002" />
<menuitem class="blabl" id="003" />
</xml>

the document.getElementById() doesn't seem to work with those menuitem tags. Do you have a suggestion?

thanks
 
Within the xml as container, you have better to include a well-formed xml document - not just an xml fragment, if you see what I mean. This is what You should structure the data island.
[tt]
<xml> <!-- with an id or not -->
<root> <!-- whatever name you want to give it -->
<menuitem class="blabl" id="001" />
<menuitem class="blabl" id="002" />
<menuitem class="blabl" id="003" />
</root>
</xml>
[/tt]
If not, you are asking for trouble.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top