HTMLHyperlinkElementUtils .protocol 特性为 USVString representing the protocol scheme of the URL, including the final ':' .

句法

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

范例

// Let's an <a id="myAnchor" href="https://developer.mozilla.org/en-US/HTMLHyperlinkElementUtils.protocol"> element be in the document
var anchor = document.getElementById("myAnchor");
var result = anchor.protocol; // Returns:'https:'
					

规范

规范 状态 注释
HTML 实时标准
The definition of 'HTMLHyperlinkElementUtils.protocol' in that specification.
实时标准 初始定义。

浏览器兼容性

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. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
协议 Chrome Yes
Yes
Starting in Chrome 52, this property was moved to URL
Edge 12 Firefox 22
22
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.
IE 5 Opera Yes
Yes
Starting in Opera 39, this property was moved to URL
Safari Yes WebView Android Yes
Yes
Starting in Chrome 52, this property was moved to URL
Chrome Android Yes
Yes
Starting in Chrome 52, this property was moved to URL
Firefox Android 22
22
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.
Opera Android Yes
Yes
Starting in Opera 39, this property was moved to URL
Safari iOS Yes Samsung Internet Android Yes
Yes
Starting in Samsung Internet 6.0, this property was moved to URL

图例

完整支持

完整支持

见实现注意事项。

另请参阅

元数据

  • 最后修改:
  1. URL API
  2. HTMLHyperlinkElementUtils
  3. 特性
    1. hash
    2. host
    3. hostname
    4. href
    5. origin
    6. password
    7. pathname
    8. port
    9. 协议
    10. search
    11. username
  4. 方法
    1. toString()
  5. 实现通过:
    1. HTMLAnchorElement
    2. HTMLAreaElement
  6. Related pages for URL API
    1. URL
    2. URLSearchParams
    3. URLUtilsReadOnly

版权所有  © 2014-2026 乐数软件    

工业和信息化部: 粤ICP备14079481号-1