Re: DOM/javascript experienced programmer needed for simple task
| From: | Jan Schneider | Date: | Tue, 14 Jan 2003 10:50:39 +0000 |
| Subject: | Re: DOM/javascript experienced programmer needed for simple task | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-12399@lists.php.net to get a copy of this message | ||
Zitat von Greg Beaver <greg@chiaraquartet.net>:
> hi,
>
> We're using webfx.eae.net's tabpanes for the HTML:frames:phpedit template
> in
> phpDocumentor. Currently, if an anchor on an invisible tab is referenced
> by
> clicking an a href="doc.html#anchor" tag, the invisible tab will not
> display. I don't know anything about DOM manipulation and would love it
> if
> someone with a bit of knowledge could tell me how to get a list of
> anchors
> in a div element cross-browser IE 5.5+ NS 6.0+ DOM-compatible, and from
> there I'm fine because I can just retrieve the attribute once I've found
> the
> anchors. What I can't figure out is how to get the list, or the anchor
> (and
> how to tell which div it is in once I've found it). Selecting the tab
> will
> be easy, so the only stumbling block is finding which tab the anchor (a
> name=) is on.
getElementsByTagName() is what you are looking for:
http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-core.html#ID-1938918D
It can be called on any object that implements the HTMLElement interface:
var myDiv = document.getElementById('myDiv');
var myLinks = myDiv.getElementsByTagname('A');
Jan.
--
http://www.horde.org - The Horde Project
http://www.ammma.de - discover your knowledge
http://www.tip4all.de - Deine private Tippgemeinschaft