I noticed that all the answers here use inline onClick
handlers. It's generally recommended to keep HTML and Javascript separate.
Here's an answer that adds a click event listener directly to the button. When it's clicked, it calls location.reload which causes the page to reload with the current URL.
const refreshButton = document.querySelector('.refresh-button');_x000D_
_x000D_
const refreshPage = () => {_x000D_
location.reload();_x000D_
}_x000D_
_x000D_
refreshButton.addEventListener('click', refreshPage)
_x000D_
.demo-image {_x000D_
display: block;_x000D_
}
_x000D_
<button class="refresh-button">Refresh!</button>_x000D_
<img class="demo-image" src="https://picsum.photos/200/300">
_x000D_