Toggle navigation
☰
Home
HTML
CSS
Scripting
Database
<!DOCTYPE html> <title>My Example</title> <script> // Wait for DOM to load document.addEventListener("DOMContentLoaded", function(event) { // Put the button into a variable var e = document.getElementById("go"); // Wait for user to click the button e.addEventListener("click", function() { // Refresh current page document.location.reload(true); }, false); // Test the refresh by outputting the time in milliseconds document.getElementById("timestamp").innerText = new Date().getTime(); }); </script> <!-- Replace '{action page}' with your own action page to support non-JavaScript users --> <form name="myForm" action="{action page}"> <input name="go" id="go" type="button" value="Refresh"> </form> <p><span id="timestamp"></span> milliseconds since midnight, January 1, 1970.</p>