Use confirm method in if statement : confirm : Dialogs JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Dialogs » confirm »

 

Use confirm method in if statement

















<html>
<head>
<script language="JavaScript" type = "text/javascript">
<!--
var username = prompt("Type your name:""");

if (confirm("Your name is: " + username + ". Is that correct?"== true )
{
  alert("Hello " + username);
}
else
{
  alert("Hi");
}
//-->
</script>
</head>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Dialogs
» confirm