Open In App

HTML DOM Location reload() Method

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.






<!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:

Article Tags :