confirm()
In this chapter you will learn:
window.confirm()
confirm(msg)
displays a OK/Cancel prompt dialog.
<!DOCTYPE HTML> <!-- ja v a 2s. co m-->
<html>
<body>
<script type="text/javascript">
if (confirm("Are you sure?")) {
document.writeln("I'm so glad you're sure! ");
} else {
document.writeln("I'm sorry to hear you're not sure. ");
}
</script>
</body>
</html>
Next chapter...
What you will learn in the next chapter:
Home » Javascript Tutorial » Window