<html>
<head>
<title>Confirming Something</title>
<script type = "text/javascript">
function processConfirm(answer) {
var result = "";
if (answer) {
result = "Yes";
} else {
result = "No";
}
return result;
}
</script>
</head>
<body>
<script type = "text/javascript">
var confirmAnswer = confirm("Yes or no?");
var theAnswer = processConfirm(confirmAnswer);
document.write(theAnswer);
</script>
</body>
</html>
|