Home Top Ad

Responsive Ads Here

Write a program to Confirm Dilog Box

Share:

 


<html>

<body>

<h2>JavaScript Confirm Box</h2>


<button onclick="myFunction()">Click Me</button>

<p id="demo"></p>

<script>

function myFunction() {

  var txt;

  if (confirm("Press a button!")) {

    txt = "You pressed OK!";

  } else {

    txt = "You pressed Cancel!";

  }

  document.getElementById("demo").innerHTML = txt;

}

</script>


</body>

</html>


Post a Comment

No comments

Welcome to saveracom.blogspot.com

Data Science using Spreadsheet Software Assignment 3

Printing Workbooks select the cells you want to print and then set that area as the print area   Steps to set a print area: Select the cells...