Answers for "close alert in javascript and didn't open again when refresh the page"

CSS
1

alert without page refresh

// note that its the return false; that prevents the page refresh.
<button onclick="alert('Hello'); return false;">Click</button>
Posted by: Guest on July-07-2020
0

javascript alert on refresh

window.onbeforeunload = function() {
  return "Data will be lost if you leave the page, are you sure?";
};
Posted by: Guest on May-09-2021

Code answers related to "close alert in javascript and didn't open again when refresh the page"

Browse Popular Code Answers by Language