X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Area protocol Property

Area Object Reference Area Object

Example

Return the protocol of the URL for a specific area in an image-map:

var x = document.getElementById("venus").protocol;

The result of x will be:

http:

Try it yourself »


Definition and Usage

The protocol property sets or returns the protocol part of the href attribute value.

The href attribute specifies the destination of a link in an area.

The protocol is a standard that specifies how data are transmitted between computers.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The protocol property is supported in all major browsers.


Syntax

Return the portocol property:

areaObject.protocol

Set the protocol property:

areaObject.protocol=protocol

Property Values

Value Description
protocol The protocol of a URL. Possible Values:
  • file:
  • ftp:
  • http:
  • https:
  • mailto:
  • etc..

Technical Details

Return Value: A String, representing the protocol part of the URL, including the colon sign (:)


More Examples

Example

Change the protocol part of a specific area in an image-map:

document.getElementById("venus").protocol = "mailto:";

Try it yourself »


Related Pages

JavaScript reference: location.protocol Property


Area Object Reference Area Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook