In this example, we have an HTML button with the ID reloadButton. The JavaScript code uses addEventListener to listen for the 'click' event on the button. When the button is clicked, it will call the reloadPage() function, which in turn reloads the current page using location.reload().

You can customize the button text, style, and placement as needed in your HTML code.

<button id="reloadButton">Reload Page</button>



  // Reload the page when the button is clicked

  document.getElementById('reloadButton').addEventListener('click', reloadPage);

  // Reload the current page

  function reloadPage() {