Thursday, 12 March 2015
Javascript three types of dialog boxes
<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>
<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>
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment