Location protocol property
Definition and Usage
protocol property is a readable and writable string sets or returns the URL of the current agreement.
grammar
location.protocol
Browser Support
All major browsers support protocol property
Examples
Examples
Returns the protocol part of the current URL:
<script>
document.write(location.protocol);
</script>
document.write(location.protocol);
</script>
Examples of the above output:
try it"
Location Object