How to take input from user in javascript ?
In this post i am going to write a java-script code to take a input from the user,
nothing fancy, just a simple yes or no input,
so here is the code to do that
so first comes the HTML, where the javascript file is going to be called,
<html>
<head>
<title>Cookie Alert !</title>
<script type="text/javascript" src="Confirm_script.js">
</script>
</head>
<body>
<noscript>
<h2>**SHABANG**!</h2>
</noscript>
</body>
</html>
and here is what goes into Confirm_script.js
var ans = prompt("Are you sure you want to do that","");
if (ans){
alert("You said " + ans)
}
else{
alert("Y u no answer ???")
}