Open In App

HTML DOM Location reload() Method

Last Updated : 29 Jan, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

The location reload() method in HTML DOM is used to reload the current document. This method refreshes the current documents. It is similar to the refresh button in the browser. 

Note: It does not return any value. 

Syntax:

location.reload( forceGet )

Parameters:

It does not take any parameters

Example: This example illustrates the use of the location reload( ) method.

HTML




<!DOCTYPE html>
<html>
 
<head>
    <title>
        HTML DOM Location reload() Method
    </title>
 
    <script>
        function ReloadLocation() {
            location.reload();
        }
    </script>
</head>
 
<body>
    <h1>GeeksforGeeks</h1>
    <h2>
        HTML DOM Location reload() Method
    </h2>
    <p>
        Click on the button to reload the document
    </p>
 
    <button onclick="ReloadLocation()">
        Reload page
    </button>
</body>
 
</html>


Output: 

Supported Browsers:

  • Google Chrome 1
  • Edge 12
  • Firefox 1
  • Opera 3
  • Safari 1

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads