Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Link href property

Link href property

Link Object Reference Link Object


Definition and Usage

The href property is a read-write string that sets or returns the complete URL of the currently displayed document.

Syntax

Set the href property:

linkObject.href="

URL

"

Return the href property:

linkObject.href


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the href property.


Example

Example

Toggle the style sheet when a button is clicked:

Runoob Tutorial(runoob.com)

    

My website homepage

Try it »


Link Object Reference Link Object