1. When talking IE it is best to give ver number as they all work differently. I check the below code in IE8 and it works for me.
2. We are in the dark and have to guess if code is not supplied.
3. java
servlets is for a different language, java not javascript.
What I check:
Code:
<!DOCTYPE html>
<html>
<body>
<p>Click the button to display a confirm box.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction()
{
var x;
var r=confirm("Press a button!");
if (r==true)
{
x="You pressed OK!";
}
else
{
x="You pressed Cancel!";
}
document.getElementById("demo").innerHTML=x;
}
</script>
</body>
</html>
4. Such things as confirm boxes, prompt boxes, and alert boxes are not used much in programming anymore except for testing purposes.