The HTMLHyperlinkElementUtils.toString()
stringifier method returns a USVString
containing the whole URL. It is a read-only version of HTMLHyperlinkElementUtils.href
.
Syntax
string = object.toString();
Examples
// Let's imagine an <a id="myAnchor" href="https://developer.mozilla.org/en-US/docs/HTMLHyperlinkElementUtils/toString"> element is in the document
var anchor = document.getElementById("myAnchor");
var result = anchor.toString(); // Returns: 'https://developer.mozilla.org/en-US/docs/HTMLHyperlinkElementUtils/toString'
Specifications
Specification | Status | Comment |
HTML Living Standard | Living Standard |
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
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 |
Legend
- Full support
- Full support
- No support
- No support
- See implementation notes.'
- See implementation notes.
See also
- The
HTMLHyperlinkElementUtils
mixin it belongs to.
HTMLHyperlinkElementUtils.toString() by Mozilla Contributors is licensed under CC-BY-SA 2.5.