Skip to content
Related Articles
Open in App
Not now

Related Articles

HTML | DOM referrer Property

Improve Article
Save Article
Like Article
  • Last Updated : 12 Aug, 2022
Improve Article
Save Article
Like Article

The DOM referrer property in HTML is used to return the URI of the page that linked to the current page. If the user navigates to the page directly or through a bookmark, then this value is an empty string.
Syntax:
 

document.referrer

Return Value: A String, representing the URL of the document that loaded the current document. Returns the entire URL, including the protocol (like http://). If the current document was not opened through a link (for example, through a bookmark), an empty string is returned.

Below program illustrates the referrer property in HTML:
Example: There are 3 pages which link each other and specify their referrer property below.
 

page1.html

 

page2.html

 

page3.html

 


 

Supported Browsers: The browser supported by DOM referrer property are listed below: 
 

  • Chrome 1 and above
  • Edge 12 and above
  • Internet Explorer 4 and above
  • Firefox 1 and above
  • Opera 3 and above
  • Safari 1 and above

 

My Personal Notes arrow_drop_up
Like Article
Save Article
Related Articles

Start Your Coding Journey Now!