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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to select childnodes by name?

Status
Not open for further replies.

dcnguyen

Technical User
Mar 22, 2005
54
0
0
US
Is there a built-in JS function to select a childnode by name? For example:

<book>
<authors>
<author>
<author>
</authors>
<price>
</price>
</book>

How would I go about selecting the price node?
 
The names you want are tagNames.

myTaggedElements = myParentElement.getElementsByTagName("book");




 
Yeah that's what I thought, but I get a "Object doesn't support this property or method
 
>How would I go about selecting the price node?
From where? in where? and what have you done the moment? Otherwise, open the source file, look at it and select. That certainly is not what you meant.
 
Oops, nevermind...The function works, I was calling it as a member function from something that wasn't a node...Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top