JavaScript confirm OK and Cancel
<button onclick="confirmYesAndCandel()">Confirm Yes or Cancel ?</button> <p id="demo"></p> <script> function confirmYesAndCandel() { var txt; if (confirm("Press OK or Cancel!")) { txt = "You pressed OK!"; } else { txt = "You pressed Cancel!"; } document.getElementById("demo").innerHTML = txt; } </script>
18 Related pages
- Date and Time JavaScript
- Display Date, JavaScripts
- Display Date, JS
- External JavaScripts in HTML head
- JavaScript confirm OK and Cancel
- JavaScript Promise API
- JavaScript redirect to
- JavaScript toggle class
- JS alert in php
- JS Blinking Text
- JS Date
- JS display image preview on the form before submit
- JS image inside ul li
- JS Numeric Sort
- JS prevent form resubmission
- JS, pop( ) remove last element in the array
- JS, push() adds to the last element in the array
- Timeout JS