The HTMLHyperlinkElementUtils.protocol property is a USVString representing the protocol scheme of the URL, including the final ':'.


string = object.protocol;
object.protocol = string;


// Let's an <a id="myAnchor" href=""> element be in the document
var anchor = document.getElementByID("myAnchor");
var result = anchor.protocol; // Returns:'https:'


Specification Status Comment
HTML Living Standard
The definition of 'HTMLHyperlinkElementUtils.protocol' in that specification.
Living Standard Initial definition.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support Yes1 No222 No No No
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support Yes1 Yes1 No222 No No ?

1. Starting in Chrome 52, this property was moved to URL

2. From Firefox 22 to Firefox 44, this property was on the URLUtils mixin. It has been moved either on the HTMLHyperlinkElementUtils mixin, or directly on the interface.

See also

Document Tags and Contributors

Last updated by: fscholz,