Free Software,Free Society

Thursday, 12 March 2015

Javascript three types of dialog boxes

No comments :
<html>
<head>
<title>java 3alerts<acp></title>
</head>
<body>
<h1>javascript 3 method
<ul>
      <li>1->alert</li>
      <li> 2->confirm</li>
      <li> 3->prompt</li>
       </ul>
       </h1>

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

<script type="text/javascript">

alert(" hi this is alert box ");

var p=prompt("Hi this is prompt box","Enter here");
if(p!=null){
document.getElementById("demo").innerHTML="Hello" + p + "how r u";

}

var r =confirm("Hi this is confirm box");
if(r == true){
x="you passed ok";
alert(x);
}
else{
 x = "you passed cancel";
 alert(x);
}
</script>
</body>
</html>

No comments :

Post a Comment