Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

HTML | DOM referrer Property

  • Last Updated : 13 Aug, 2021

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
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

 

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!