為什么點擊了alert之后,頁面上出現(xiàn)了兩個input?????
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>window對象</title>
<script type="text/javascript">
alert("歡迎來到慕課網(wǎng)");
function openWindow(){
??? window.open('http://www.baidu.com',"_blank",'width = 600','height = 400')
}
</script>
</head>
<body>
<form>
<input type="button" value="點擊我,打開新窗口"? onclick="openWindow()"/>
</form>
</body>
</html>
2019-05-24
window.open('http://www.baidu.com',"_blank",'width = 600','height = 400')后面加個分號試試
2018-07-30
可能是慕課的編輯器有問題,我把你代碼復制到html里面運行沒有彈出兩次input