I need a button that will refresh the page on the user's click. I tried this:
<input type="button" value="Reload Page" onClick="reload">
or
<input type="button" value="Refresh Page" onClick="refresh">
But neither worked.
Use onClick
with window.location.reload()
, i.e. :
<button onClick="window.location.reload();">Refresh Page</button>
Or history.go(0)
, i.e.:
<button onClick="history.go(0);">Refresh Page</button>
Or window.location.href=window.location.href
for 'full' reload, i.e.:
<button onClick="window.location.href=window.location.href">Refresh Page</button>