【发布时间】:2015-04-12 18:57:33
【问题描述】:
我有一个使用下面给出的 javascript 代码创建的确认框。获得确认框后,如果我使用鼠标拖动它并离开它,它会打开一个新的确认框,之前的确认框也在 IE11 中打开。因此,这样做不断打开这么多的确认框。但它在 IE8 中运行良好。请建议如何处理这个问题。是 IE11 的 bug 吗?
<!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 txt;
var r = confirm("Press a button!");
if (r == true) {
txt = "You pressed OK!";
} else {
txt = "You pressed Cancel!";
}
document.getElementById("demo").innerHTM L = txt;
}
</script>
【问题讨论】:
-
可能是你的 IE 的 bug。
标签: javascript html web-applications internet-explorer-11