This is an experimental technologyCheck the Browser compatibility table carefully before using this in production.
The HTMLHyperlinkElementUtils mixin defines utility methods and properties to work with HTMLAnchorElement and HTMLAreaElement. These utilities allow to deal with common features like URLs.
There are no objects of this type, but several objects such as HTMLAnchorElement and HTMLAreaElement implement it.
Properties
Note: This interface doesn't inherit any property.
HTMLHyperlinkElementUtils.href- This a stringifier property that returns a
USVStringcontaining the whole URL, and allows the href to be updated. HTMLHyperlinkElementUtils.protocol- This is a
USVStringcontaining the protocol scheme of the URL, including the final':'. HTMLHyperlinkElementUtils.host- This is a
USVStringcontaining the host, that is the hostname, and then, if the port of the URL is not empty (which can happen because it was not specified or because it was specified to be the default port of the URL's scheme), a':', and the port of the URL. HTMLHyperlinkElementUtils.hostname- This is a
USVStringcontaining the domain of the URL. HTMLHyperlinkElementUtils.port- This is a
USVStringcontaining the port number of the URL. HTMLHyperlinkElementUtils.pathname- Is a
USVStringcontaining an initial'/'followed by the path of the URL, not including the query string or fragment. HTMLHyperlinkElementUtils.search- This is a
USVStringcontaining a'?'followed by the parameters of the URL. HTMLHyperlinkElementUtils.hash- This is a
USVStringcontaining a'#'followed by the fragment identifier of the URL. HTMLHyperlinkElementUtils.username- This is a
USVStringcontaining the username specified before the domain name. HTMLHyperlinkElementUtils.password- This is a
USVStringcontaining the password specified before the domain name. HTMLHyperlinkElementUtils.originRead only- This returns a
USVStringcontaining the origin of the URL (that is its scheme, its domain and its port).
Methods
Note: This interface doesn't inherit any method.
HTMLHyperlinkElementUtils.toString()- This returns a
USVStringcontaining the whole URL. It is a synonym forHTMLHyperlinkElementUtils.href, though it can't be used to modify the value.
Specifications
| Specification | Status | Comment |
|---|---|---|
| HTML Living StandardThe definition of 'HTMLHyperlinkElementUtils' in that specification. | Living Standard | Initial definition |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
HTMLHyperlinkElementUtils
|
Chrome Full support Yes Full support Yes Notes' Starting in Chrome 52, the members of this interface were moved to URL |
Edge
Full support 12 |
Firefox Full support 22 Full support 22 Notes' This mixin was called |
IE
Full support 5 |
Opera Full support Yes Full support Yes Notes' Starting in Opera 39, the members of this interface were moved to URL |
Safari
Full support Yes |
WebView Android Full support Yes Full support Yes Notes' Starting in Chrome 52, the members of this interface were moved to URL |
Chrome Android Full support Yes Full support Yes Notes' Starting in Chrome 52, the members of this interface were moved to URL |
Firefox Android Full support 22 Full support 22 Notes' This mixin was called |
Opera Android Full support Yes Full support Yes Notes' Starting in Opera 39, the members of this interface were moved to URL |
Safari iOS
Full support Yes |
Samsung Internet Android Full support Yes Full support Yes Notes' Starting in Samsung Internet 6.0, the members of this interface were moved to URL |
hash
|
Chrome Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Edge
Full support 12 |
Firefox Full support 22 Full support 22 Notes' From Firefox 22 to Firefox 44, this property was on the |
IE
Full support 5 |
Opera Full support Yes Full support Yes Notes' Starting in Opera 39, this property was moved to URL |
Safari
Full support Yes |
WebView Android Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Chrome Android Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Firefox Android Full support 22 Full support 22 Notes' From Firefox 22 to Firefox 44, this property was on the |
Opera Android Full support Yes Full support Yes Notes' Starting in Opera 39, this property was moved to URL |
Safari iOS
Full support Yes |
Samsung Internet Android Full support Yes Full support Yes Notes' Starting in Samsung Internet 6.0, this property was moved to URL |
host
|
Chrome Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Edge
Full support 12 |
Firefox Full support 22 Full support 22 Notes' From Firefox 22 to Firefox 44, this property was on the |
IE Full support 5 Full support 5 Notes' In Internet Explorer 9, the host of an |
Opera Full support Yes Full support Yes Notes' Starting in Opera 39, this property was moved to URL |
Safari
Full support Yes |
WebView Android Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Chrome Android Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Firefox Android Full support 22 Full support 22 Notes' From Firefox 22 to Firefox 44, this property was on the |
Opera Android Full support Yes Full support Yes Notes' Starting in Opera 39, this property was moved to URL |
Safari iOS
Full support Yes |
Samsung Internet Android Full support Yes Full support Yes Notes' Starting in Samsung Internet 6.0, this property was moved to URL |
hostname
|
Chrome Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Edge
Full support 12 |
Firefox Full support 22 Full support 22 Notes' From Firefox 22 to Firefox 44, this property was on the |
IE
Full support 5 |
Opera Full support Yes Full support Yes Notes' Starting in Opera 39, this property was moved to URL |
Safari
Full support Yes |
WebView Android Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Chrome Android Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Firefox Android Full support 22 Full support 22 Notes' From Firefox 22 to Firefox 44, this property was on the |
Opera Android Full support Yes Full support Yes Notes' Starting in Opera 39, this property was moved to URL |
Safari iOS
Full support Yes |
Samsung Internet Android Full support Yes Full support Yes Notes' Starting in Samsung Internet 6.0, this property was moved to URL |
href
|
Chrome Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Edge
Full support 12 |
Firefox Full support 22 Full support 22 Notes' From Firefox 22 to Firefox 44, this property was on the |
IE
Full support 5 |
Opera Full support Yes Full support Yes Notes' Starting in Opera 39, this property was moved to URL |
Safari
Full support Yes |
WebView Android Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Chrome Android Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Firefox Android Full support 22 Full support 22 Notes' From Firefox 22 to Firefox 44, this property was on the |
Opera Android Full support Yes Full support Yes Notes' Starting in Opera 39, this property was moved to URL |
Safari iOS
Full support Yes |
Samsung Internet Android Full support Yes Full support Yes Notes' Starting in Samsung Internet 6.0, this property was moved to URL |
origin
|
Chrome Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Edge
Full support 17 |
Firefox Full support 26 Full support 26 Notes' From Firefox 26 to Firefox 44, this property was on the |
IE
No support No |
Opera Full support Yes Full support Yes Notes' Starting in Opera 39, this property was moved to URL |
Safari
Full support Yes |
WebView Android Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Chrome Android Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Firefox Android Full support 26 Full support 26 Notes' From Firefox 26 to Firefox 44, this property was on the |
Opera Android Full support Yes Full support Yes Notes' Starting in Opera 39, this property was moved to URL |
Safari iOS
Full support Yes |
Samsung Internet Android Full support Yes Full support Yes Notes' Starting in Samsung Internet 6.0, this property was moved to URL |
password
|
Chrome Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Edge
Full support 79 |
Firefox Full support 26 Full support 26 Notes' From Firefox 26 to Firefox 44, this property was on the |
IE
No support No |
Opera Full support Yes Full support Yes Notes' Starting in Opera 39, this property was moved to URL |
Safari
Full support Yes |
WebView Android Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Chrome Android Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Firefox Android Full support 26 Full support 26 Notes' From Firefox 26 to Firefox 44, this property was on the |
Opera Android Full support Yes Full support Yes Notes' Starting in Opera 39, this property was moved to URL |
Safari iOS
Full support Yes |
Samsung Internet Android Full support Yes Full support Yes Notes' Starting in Samsung Internet 6.0, this property was moved to URL |
pathname
|
Chrome Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Edge
Full support 12 |
Firefox Full support 22 Full support 22 Notes' From Firefox 22 to Firefox 44, this property was on the |
IE
Full support 5 |
Opera Full support Yes Full support Yes Notes' Starting in Opera 39, this property was moved to URL |
Safari
Full support Yes |
WebView Android Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Chrome Android Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Firefox Android Full support 22 Full support 22 Notes' From Firefox 22 to Firefox 44, this property was on the |
Opera Android Full support Yes Full support Yes Notes' Starting in Opera 39, this property was moved to URL |
Safari iOS
Full support Yes |
Samsung Internet Android Full support Yes Full support Yes Notes' Starting in Samsung Internet 6.0, this property was moved to URL |
port
|
Chrome Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Edge
Full support 12 |
Firefox Full support 22 Full support 22 Notes' From Firefox 22 to Firefox 44, this property was on the |
IE
Full support 5 |
Opera Full support Yes Full support Yes Notes' Starting in Opera 39, this property was moved to URL |
Safari
Full support Yes |
WebView Android Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Chrome Android Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Firefox Android Full support 22 Full support 22 Notes' From Firefox 22 to Firefox 44, this property was on the |
Opera Android Full support Yes Full support Yes Notes' Starting in Opera 39, this property was moved to URL |
Safari iOS
Full support Yes |
Samsung Internet Android Full support Yes Full support Yes Notes' Starting in Samsung Internet 6.0, this property was moved to URL |
protocol
|
Chrome Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Edge
Full support 12 |
Firefox Full support 22 Full support 22 Notes' From Firefox 22 to Firefox 44, this property was on the |
IE
Full support 5 |
Opera Full support Yes Full support Yes Notes' Starting in Opera 39, this property was moved to URL |
Safari
Full support Yes |
WebView Android Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Chrome Android Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Firefox Android Full support 22 Full support 22 Notes' From Firefox 22 to Firefox 44, this property was on the |
Opera Android Full support Yes Full support Yes Notes' Starting in Opera 39, this property was moved to URL |
Safari iOS
Full support Yes |
Samsung Internet Android Full support Yes Full support Yes Notes' Starting in Samsung Internet 6.0, this property was moved to URL |
search
|
Chrome Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Edge
Full support 12 |
Firefox Full support 22 Full support 22 Notes' From Firefox 22 to Firefox 44, this property was on the |
IE
Full support 5 |
Opera Full support Yes Full support Yes Notes' Starting in Opera 39, this property was moved to URL |
Safari
Full support Yes |
WebView Android Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Chrome Android Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Firefox Android Full support 22 Full support 22 Notes' From Firefox 22 to Firefox 44, this property was on the |
Opera Android Full support Yes Full support Yes Notes' Starting in Opera 39, this property was moved to URL |
Safari iOS
Full support Yes |
Samsung Internet Android Full support Yes Full support Yes Notes' Starting in Samsung Internet 6.0, this property was moved to URL |
toString
|
Chrome
Full support 52 |
Edge
Full support ≤18 |
Firefox Full support 22 Full support 22 Notes' From Firefox 22 to Firefox 44, this property was on the |
IE
No support No |
Opera
Full support Yes |
Safari
Full support Yes |
WebView Android
Full support 52 |
Chrome Android
Full support 52 |
Firefox Android Full support 22 Full support 22 Notes' From Firefox 22 to Firefox 44, this property was on the |
Opera Android
Full support Yes |
Safari iOS
Full support Yes |
Samsung Internet Android
Full support 6.0 |
username
|
Chrome Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Edge
Full support 79 |
Firefox Full support 26 Full support 26 Notes' From Firefox 26 to Firefox 44, this property was on the |
IE
No support No |
Opera Full support Yes Full support Yes Notes' Starting in Opera 39, this property was moved to URL |
Safari
Full support Yes |
WebView Android Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Chrome Android Full support Yes Full support Yes Notes' Starting in Chrome 52, this property was moved to URL |
Firefox Android Full support 26 Full support 26 Notes' From Firefox 26 to Firefox 44, this property was on the |
Opera Android Full support Yes Full support Yes Notes' Starting in Opera 39, this property was moved to URL |
Safari iOS
Full support Yes |
Samsung Internet Android Full support Yes Full support Yes Notes' Starting in Samsung Internet 6.0, this property was moved to URL |
Legend
- Full support
- Full support
- No support
- No support
- See implementation notes.'
- See implementation notes.
See also
- Interfaces implementing this one:
HTMLAnchorElement,HTMLAreaElement
HTMLHyperlinkElementUtils by Mozilla Contributors is licensed under CC-BY-SA 2.5.