CBSE 4. WEB SCRIPTING - JAVA SCRIPT (5 MARKS)

 

12. Showing Confirm Box

JavaScript

<!DOCTYPE html>

<html>

<head>

<title>Confirm Box</title>

</head>

<body>

 

<script>

  if (confirm("Do you want to continue?")) {

    alert("You clicked OK");

  } else {

    alert("You clicked Cancel");

  }

</script>

 

</body>

</html>

This will display a confirm box with an "OK" and "Cancel" button.

No comments:

Post a Comment