confirm



examples/js/confirm.html
<h2>Before</h2>

<script>

if (confirm("Shall I print Hello World?")) {
    document.write("Hello World");
} else {
    document.write("OK, I won't print it.");
}

</script>

<h2>After</h2>