A | NN n/a IE 4 DOM 1 | ||||
The A object reflects the A element, regardless of whether the element is set up to be an anchor, link, or both. Navigator and Internet Explorer both treat this object as a member of the links[] and/or anchors[] arrays of a document. Internet Explorer 4 also lets you reference the object as a member of the document.all[] collection (array of all HTML elements). | |||||
HTML Equivalent<A> | |||||
Object Model Reference
|
accessKey | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
A single character key that either brings focus to an element or, in
the case of an A element (as a link), follows the
link. The browser and operating system determine whether the user
must press a modifier key (e.g., | |||
Exampledocument.links[3].accessKey = "n" | |||
Value Single alphanumeric (and punctuation) keyboard character. | |||
|
dataFld | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
Used with IE 4 data binding to associate a remote data source column value in lieu of an HREF attribute for a link. The DATASRC attribute must also be set for the element. Setting both the dataFld and dataSrc properties to empty strings breaks the binding between element and data source. | |||
Exampledocument.all.hotlink.dataFld = "linkURL" | |||
Value Case-sensitive identifier of the data source column. | |||
|
dataSrc | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
Used with IE 4 data binding to specify the name of the remote ODBC data source (such as an Oracle or SQL Server database) to be associated with the element. Setting both the dataFld and dataSrc properties to empty strings breaks the binding between element and data source. | |||
Exampledocument.all.hotlink.dataSrc = "#DBSRC3" | |||
Value Case-sensitive identifier of the data source. | |||
|
hash | NN 2 IE 3 DOM 1 | ||
Read/Write | |||
That portion of the HREF attribute's URL following the # symbol, referring to an anchor location in a document. Do not include the # symbol when setting the property. | |||
Exampledocument.all.myLink.hash = "section3" document.links[2].hash = "section3" | |||
Value String. | |||
|
host | NN 2 IE 3 DOM 1 | ||
Read/Write | |||
The combination of the hostname and port (if any) of the server of the destination document for the link. If the port is explicitly part of the URL, the hostname and port are separated by a colon, just as they are in the URL. If the port number is not specified in an HTTP URL for IE 4, it automatically returns the default, port 80. | |||
Exampledocument.all.myLink.host = "www.megacorp.com:80" document.links[2].host = "www.megacorp.com:80" | |||
Value String of hostname optionally followed by a colon and port number. | |||
|
hostname | NN 2 IE 3 DOM 1 | ||
Read/Write | |||
The hostname of the server (i.e., a "two-dot" address consisting of server name and domain) of the destination document for the link. The hostname property does not include the port number. | |||
Exampledocument.all.myLink.hostname = "www.megacorp.com" document.links[2].hostname = "www.megacorp.com" | |||
Value String of host name (server and domain). | |||
|
href | NN 2 IE 3 DOM 1 | ||
Read/Write | |||
The URL specified by the element's HREF attribute. | |||
Exampledocument.all.myLink.href = "http://www.megacorp.com" document.links[2].href = "http://www.megacorp.com" | |||
Value String of complete or relative URL. | |||
|
Methods | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
An advisory attribute about the functionality of the destination of a link. A browser could use this information to display special colors or images for the element content based on what the destination does for the user, but Internet Explorer 4 does not appear to do anything with this information. | |||
Exampledocument.links[1].Methods = "post" | |||
Value Any valid HTTP method as a string. | |||
|
mimeType | NN n/a IE 4 DOM n/a | ||
Read-only | |||
Returns a plain-language version of the MIME type of the destination document at the other end of the link specified by the HREF or SRC attribute. You could use this information to set the cursor type during a mouse rollover. Do not confuse this property with the navigator.mimeTypes[] array and individual mimeType objects that Netscape Navigator refers to. Not available in IE 4/Macintosh. | |||
Exampleif (document.all.myLink.mimeType == "GIF Image") { ... } | |||
Value A plain-language reference to the MIME type as a string. | |||
|
name | NN 2 IE 3 DOM 1 | ||
Read/Write | |||
The identifier associated with an element that turns it into an anchor. You can also use the name as part of the object reference. | |||
Exampleif (document.links[3].name == "section3") { ... } | |||
Value Case-sensitive identifier that follows the rules of identifier naming: it may contain no whitespace, cannot begin with a numeral, and should avoid punctuation except for the underscore character. | |||
|
nameProp | NN n/a IE 4 DOM n/a | ||
Read-only | |||
Returns just the filename, rather than the full URL, of the HREF attribute set for the element. Not available in IE 4/Macintosh. | |||
Exampleif (document.all.myElement.nameProp == "logo2.gif") { ... } | |||
Value String. | |||
|
pathname | NN 2 IE 3 DOM 1 | ||
Read/Write | |||
The pathname component of the URL assigned to the element's HREF attribute. This consists of all URL information following the last character of the domain name, including the initial forward slash symbol. | |||
Exampledocument.all.myLink.pathname = "/images/logoHiRes.gif" document.links[2].pathname = "/images/logoHiRes.gif" | |||
Value String. | |||
|
port | NN 2 IE 3 DOM 1 | ||
Read/Write | |||
The port component of the URL assigned to the element's HREF attribute. This consists of all URL information following the colon after the last character of the domain name. The colon is not part of the port property value. | |||
Exampledocument.all.myLink.port = "80" document.links[2].port = "80" | |||
Value String (a numeric value as string). | |||
|
protocol | NN 2 IE 3 DOM 1 | ||
Read/Write | |||
The protocol component of the URL assigned to the element's HREF attribute. This consists of all URL information up to and including the first colon of a URL. Typical values are: "http:", "file:", "ftp:", and "mailto:". | |||
Exampledocument.all.secureLink.protocol = "https" document.secureLink.protocol = "https" | |||
Value String. | |||
|
protocolLong | NN n/a IE 4 DOM n/a | ||
Read-only | |||
A verbose description of the protocol implied by the URL of the HREF attribute or href property. Not supported in IE 4/Macintosh. | |||
Exampleif (document.all.myLink.protocolLong == "HyperText Transfer Protocol") { } | |||
Value String. | |||
|
recordNumber | NN n/a IE 4 DOM n/a | ||
Read-only | |||
Used with data binding, returns an integer representing the record within the data set that generated the element). Values of this property can be used to extract a specific record from an Active Data Objects (ADO) record set (see recordset property). | |||
Example<SCRIPT FOR="tableTemplate" EVENT="onclick"> myDataCollection.recordset.absoluteposition = this.recordNumber ... </SCRIPT> | |||
Value Integer. | |||
|
rel | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
Defines the relationship between the current element and the
destination of the link. Also known as a forward
link, not to be confused in any way with the destination
document whose address is defined by the HREF
attribute. This property is not used yet in Internet Explorer 4, but
you can treat the attribute as a kind of parameter to be checked
and/or modified under script control. See the discussion of the
A element's REL attribute
in | |||
Value Case-insensitive, space-delimited list of HTML 4.0 standard link types (as a single string) applicable to the element. Sanctioned link types are: | |||
|
rev | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
Defines the relationship between the current element and the
destination of the link. Also known as a reverse
link. This property is not used yet in Internet Explorer
4, but you can treat the attribute as a kind of parameter to be
checked and/or modified under script control. See the discussion of
the A element's REV
attribute in | |||
Value Case-insensitive, space-delimited list of HTML 4.0 standard link types (as a single string) applicable to the element. See the rel property for sanctioned link types. | |||
|
search | NN 2 IE 3 DOM 1 | ||
Read/Write | |||
The URL-encoded portion of a URL assigned to the HREF attribute that begins with the ? symbol. A document that is served up as the result of the search also may have the search portion available as part of the window.location property. You can modify this property with a script. Doing so sends the URL and search criteria to the server. You must know the format of data (usually name/value pairs) expected by the server to perform this properly. | |||
Exampledocument.all.searchLink.search="?p=Tony+Blair&d=y&g=0&s=a&w=s&m=25" document.links[1].search="?p=Tony+Blair&d=y&g=0&s=a&w=s&m=25" | |||
Value String starting with the ? symbol. | |||
|
tabIndex | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
A number that indicates the sequence of this element within the tabbing order of all focusable elements in the document. Tabbing order follows a strict set of rules. Elements that have values other than zero assigned to their tabIndex properties are first in line when a user starts tabbing in a page. Focus starts with the element with the lowest tabIndex value and proceeds in order to the highest value, regardless of physical location on the page or in the document. If two elements have the same tabIndex values, the element that comes earlier in the document receives focus first. Next come all elements that either don't support the tabIndex property or have the value set to zero. These elements receive focus in the order in which they appear in the document. A value of -1 removes the element from tabbing order altogether. Note that the Macintosh user interface does not provide for giving focus to elements other than text and password INPUT fields. | |||
Exampledocument.all.link3.tabIndex = 6 | |||
Value Integer. | |||
|
target | NN 2 IE 3 DOM 1 | ||
Read/Write | |||
The name of the window or frame that is to receive content as the result of navigating to a link. Such names are assigned to frames by the FRAME element's NAME attribute; for subwindows, the name is assigned via the second parameter of the window.open( ) method. If you are scripting the navigation of another window or frame, use the window or frame name in a statement that assigns a new URL to the location.href property (frameName.location.href = "newURL"). | |||
Exampledocument.all.homeLink.target = "_top" document.links[3].target = "_top" | |||
Value String value of the window or frame name, or any of the following constants (as a string): _parent | _self | _top | _blank. The _parent value targets the frameset to which the current document belongs; the _self value targets the current window; the _top value targets the main browser window, thereby eliminating all frames; and the _blank value creates a new window of default size. | |||
|
urn | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
A Uniform Resource Name (URN) version of the destination document specified in the HREF attribute. This attribute is intended to offer support in the future for the URN format of URI, an evolving recommendation under discussion at the IETF (see RFC 2141). Although supported in IE 4, this attribute does not take the place of the HREF attribute. | |||
Exampledocument.all.link3.urn = "http://www.megacorp.com" | |||
Value Complete or relative URN as a string. | |||
|
blur( ) | NN n/a IE 4 DOM n/a |
Removes focus from the current element and fires an onBlur event (in IE). No other element necessarily receives focus as a result. | |
Returned Value None. | |
Parameters None. |
focus( ) | NN n/a IE 4 DOM n/a |
Gives focus to the current element and fires the onFocus event (in IE). If another element had focus at the time, it receives an onBlur event. | |
Returned Value None. | |
Parameters None. |