xxxxxxxxxx
const reloadtButton = document.querySelector("#reload");
// Reload everything:
function reload() {
reload = location.reload();
}
// Event listeners for reload
reloadButton.addEventListener("click", reload, false);
xxxxxxxxxx
<button type="button" onClick="refreshPage()">Close</button>
<script>
function refreshPage(){
window.location.reload();
}
</script>
xxxxxxxxxx
<button type="button" onClick="refreshPage()">Close</button>
<script>
function refreshPage(){
window.location.reload();
}
</script>
xxxxxxxxxx
function refreshPage() {
location.reload(); // Refresh the current page
}
// Attach the refreshPage function to the onclick event of the desired element
document.getElementById("elementId").onclick = refreshPage;
xxxxxxxxxx
document.querySelector(".again").addEventListener("click", function reload(){
reload=location.reload();
})
xxxxxxxxxx
document.querySelector(".again").addEventListener("click", function (){
location.reload();
})