W3C home > Mailing lists > Public > html-tidy@w3.org > October to December 2000

Re: where in the DOM data structures is href stored?

From: Gary L Peskin <garyp@firstech.com>
Date: Sat, 11 Nov 2000 22:46:04 -0800
Message-ID: <3A0E3CAC.2598F138@firstech.com>
To: jtnews <jtnews@bellatlantic.net>
CC: html-tidy@w3.org
href is an attribute of the a element.  In the DOM model
(http://www.w3.org/TR/2000/PR-DOM-Level-2-Core-20000927/core.html#ID-637646024)
an Attr is -not- a child of the element with which it is associated.  If
you have the Element for a, try getAttributes() which returns a
NamedNodeMap, or getAttribute() which returns a String with the
attribute value for a specified attribute, or getAttributeNode() which
returns an Attr node for the specified attribute.

The DOM specification referred to above explains all of this.  Check the
information under Node, Element, and Attr.

HTH,
Gary

jtnews wrote:
> 
> where in the DOM data structures is href stored?
> 
> For example,
>   <a href="http://myurl.com">myurl</a>
> 
> Where can I find "http://myurl.com" ?
> 
> I find "a" listed as an element but I can't find
> an "href" node anywhere.
Received on Sunday, 12 November 2000 01:46:24 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 April 2012 06:13:44 GMT