我有替换Div
标签的javascript代码...
<script type="text/javascript">
function showPopup(url) {
newwindow=window.open(url,'Image
Share','height=490,width=850,top=200,left=80,resizable');
if (window.focus) {newwindow.focus()}
}
function replace() {
document.getElementById("div1").style.display="none";
document.getElementById("div2").style.display="block";
}
</script>
<div id = "div1" style="display:block" onclick = "replace()">
123123123
</div>
<div id = "div2" style="display:none">454545454 </div>
那行得通,但前提是我做一次。如果我在同一页面上这样重复:
<!-- -------1------- -->
<div id = "div1" style="display:block" onclick = "replace()">
123123123
</div>
<div id = "div2" style="display:none">454545454 </div>
<!-- -------2------- -->
<div id = "div1" style="display:block" onclick = "replace()">
123123123
</div>
<div id = "div2" style="display:none">454545454 </div>
<!-- -------3------- -->
<div id = "div1" style="display:block" onclick = "replace()">
123123123
</div>
<div id = "div2" style="display:none">454545454 </div>
然后它不起作用。
我在"div1"
. 我想在弹出窗口关闭后替换它,并用成功消息替换它,或者在弹出窗口打开后禁用超链接。