how to make a refresh button using javascript

42k Views Asked by At

Can I make a function to refresh the page using JavaScript (same browser refresh button)

Thanks

3

There are 3 best solutions below

0
On BEST ANSWER

You can do this by using: window.location.reload()

0
On

I added a refresh button in a form I made.

<script>
  function refresh(){
        window.location.reload("Refresh")
      }
</script>

and then called it via button in html:

<p><input type="button" value="Refresh" onClick="refresh(this)"></p>
0
On

google? : javascript refresh

<!-- Codes by Quackit.com -->
<a href="javascript:location.reload(true)">Refresh this page</a>