How to Refresh a Page Using Javascript?
To refresh a page using Javascript, you can use the location.reload() method. This method will reload the current page when called.
Example:
In this example, a button is created and when clicked, the location.reload() method is called, causing the page to refresh.
You can also use setTimeout() function to set a time delay before the page is reloaded.
Example:
setTimeout(function(){ location.reload(); }, 5000);
In this example, the function will wait for 5 seconds before the page is reloaded using the location.reload() method.