Location protocol Property
Return the protocol portion of the current URL:
The result of x will be:
Try it yourself »
Definition and Usage
The protocol property sets or returns the protocol of the current URL, including the colon (:).
The protocol is a standard that specifies how data are transmitted between computers.
The protocol property is supported in all major browsers.
Return the protocol property:
Set the protocol property:
The protocol of the URL. Possible values:
|String||The protocol of the current URL, including the colon (:)|
Thank You For Helping Us!
Your message has been sent to W3Schools.