URL: protocol property - Web APIs | MDN
Value
A string.
Examples
js
const url = new URL(
"https://developer.mozilla.org/en-US/docs/Web/API/URL/protocol",
);
console.log(url.protocol); // Logs "https:"
Specifications
| Specification |
|---|
| URL # dom-url-protocol |
Browser compatibility
See also
- The
URLinterface it belongs to.