Share via


link HTML Object

Send Feedback

The link object designates the start or destination of a hypertext link. The link object corresponds to the A HTML element.

Properties

Note   All link object properties have a maximum URL length of 2034 characters.

Property Data type Access Description
accesskey String Read/write Sets or retrieves the number associated with the accesskey attribute.
Note   Supported only for devices running Smartphone 2002 and Pocket PC 2002 software or later.
hash String Read/write Sets or retrieves the part of the HREF after the number sign (#).
host String Read/write Sets or retrieves the host name part of the URL.
hostname String Read/write Sets or retrieves the host and domain name or the numeric IP address.
href String Read/write Sets or retrieves the destination URL or anchor point.
name String Read/write Sets or retrieves the anchor bookmark name.
Note   Supported only for devices running Smartphone 2002 and Pocket PC 2002 software or later.
pathname String Read/write Sets or retrieves the file name or path specified by the link.
port String Read/write Sets or retrieves the port specified by the link. The default values are 21 for File Transfer Protocol (FTP), 70 for the Gopher protocol, 80 for HTTP, and 443 for HTTP Secure (HTTPS).
protocol String Read/write Sets or retrieves the protocol portion of the URL. It returns the initial substring of a URL, including the colon.
search String Read/write Sets or retrieves the search (query) string portion of the HREF. This includes the leading question mark.
target String Read/write Sets or retrieves the target of the HREF.

Events

Event Description
onclick Occurs when the user selects the A element.
Note   When using the stylus on a Windows Mobile-based Pocket PC, this event occurs only when the user presses the stylus down on the <A> and then releases the selection without moving more than 5 pixels away from the point where the stylus was pressed down. You can specify a special handler for this event.

Methods

Method Syntax Description
focus link.focus Gives selection focus to the link.
Note   Supported only for devices running Smartphone 2002 and Pocket PC 2002 software or later.

Remarks

You use the links collection to retrieve a collection of all the link objects that have an href in the document. The document object supports the links collection. The following example shows how to print the href property of a link with an index of 0.

document.links[0].href

Requirements

Pocket PC: Pocket PC 2000 and later
Smartphone: Smartphone 2002 and later
OS Versions: Windows CE 3.0 and later

See Also

Internet Explorer Mobile HTML Objects

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.