JS Prac 3
<html>
<head>
<title>Practicle 1 JS</title>
<script>
function myf(){
alert("This is an alert box");
}
function mycon(){
var x;
if(confirm("Press Any")==true){
alert("You Clicked Ok !");
}else{
alert("You Clicked Cancel !");
}
}
function myprompt(){
var name = prompt("Enter your name");
if(name){
alert("You Entered "+name);
}else if(name==""){
alert("msg empty");
}else{
alert("you canceled");
}
}
</script>
</head>
<body>
<button onclick="myf()">Alert</button><br/>
<button onclick="mycon()">Confirm</button><br>
<button onclick="myprompt()">Prompt</button>
</body>
</html>
<html>
<head>
<title>Practicle 1 JS</title>
<script>
function myf(){
alert("This is an alert box");
}
function mycon(){
var x;
if(confirm("Press Any")==true){
alert("You Clicked Ok !");
}else{
alert("You Clicked Cancel !");
}
}
function myprompt(){
var name = prompt("Enter your name");
if(name){
alert("You Entered "+name);
}else if(name==""){
alert("msg empty");
}else{
alert("you canceled");
}
}
</script>
</head>
<body>
<button onclick="myf()">Alert</button><br/>
<button onclick="mycon()">Confirm</button><br>
<button onclick="myprompt()">Prompt</button>
</body>
</html>
This comment has been removed by the author.
ReplyDelete