Answers for "js button reload page"

2

how to reload page on button click in javascript

<button type="button" onClick="refreshPage()">Close</button>

<script>
function refreshPage(){
    window.location.reload();
} 
</script>
Posted by: Guest on February-19-2021
0

javascript button onclick reload page

const reloadtButton = document.querySelector("#reload");
// Reload everything:
function reload() {
    reload = location.reload();
}
// Event listeners for reload
reloadButton.addEventListener("click", reload, false);
Posted by: Guest on June-05-2020

Browse Popular Code Answers by Language