Skip to Main Content
JavaScript: The Definitive Guide, Fourth Edition
book

JavaScript: The Definitive Guide, Fourth Edition

by David Flanagan
November 2001
Intermediate to advanced content levelIntermediate to advanced
936 pages
68h 43m
English
O'Reilly Media, Inc.
Content preview from JavaScript: The Definitive Guide, Fourth Edition

Name

Link — a hypertext link

Availability

JavaScript 1.0; enhanced in JavaScript 1.1

Inherits from/Overrides

Inherits from HTMLElement

Synopsis

                  document.links[] document.links.length

Properties

Link inherits properties from HTMLElement and defines the following properties. Many of the properties represent portions of a URL. For each of these properties, the example given is a portion of the following (fictitious) URL:

http://www.oreilly.com:1234/catalog/search.html?q=JavaScript&m=10#results
hash

A read/write string property that specifies the anchor portion of the Link’s URL, including the leading hash (#) mark. For example: “#result”. This anchor portion of a URL refers to a named position within the document referenced by the Link. In HTML files, positions are named with anchors created with the <a name=" anchor_name "> tag.

host

A read/write string property that specifies the hostname and port portions of a Link’s URL. For example, “www.oreilly.com:1234”.

hostname

A read/write string property that specifies the hostname portion of a Link’s URL. For example “www.oreilly.com”.

href

A read/write string property that specifies the complete text of the Link’s URL, unlike other Link URL properties that specify only portions of the URL.

pathname

A read/write string property that specifies the pathname portion of a Link’s URL. For example “/catalog/search.html”.

port

A read/write string (not a number) property that specifies the port portion of a Link’s URL. For example “1234”. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

JavaScript: A Beginner's Guide, Fourth Edition, 4th Edition

JavaScript: A Beginner's Guide, Fourth Edition, 4th Edition

John Pollock
Coding with JavaScript For Dummies

Coding with JavaScript For Dummies

Chris Minnick, Eva Holland

Publisher Resources

ISBN: 0596000480Supplemental ContentCatalog PageErrata