Thursday, 23 August 2018

Javascript: confirm: Get confirmation from user


‘confirm’ box is used to get confirmation from user. If user Press OK, then it return true, else false.

Syntax
data = confirm(text);

confirm.html
<!DOCTYPE html>

<html>
 <head>
  <title>confirm box</title>
 </head>
 
 <body>
  <script type="text/javascript">
   var data = confirm("Are you above 18Yrs ?");
   
   document.write("You Entered " + data);
  </script>
 </body>
</html>



Previous                                                 Next                                                 Home

No comments:

Post a Comment