<!DOCTYPE?html>
<html>
?<head>
??<title>?new?document?</title>??
??<meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"/>???
??<script?type="text/javascript">??
????function?openWindow(){
???var?message=confirm("是否打開新的網(wǎng)址?");
???
????//?新窗口打開時彈出確認框,是否打開
???if(message==true){
???
??????var?new=prompt("請輸入你的網(wǎng)址:","http://idcbgp.cn");
???if(new!=null){
???window.open('new','_blank','width=400,height=500,menubar=no,toolbar=no')
???}
????//?通過輸入對話框,確定打開的網(wǎng)址,默認為?http://idcbgp.cn/
????//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
else{
alert("bye");
}
?????}
??}??
??</script>?
?</head>?
?<body>?
??<input?type="button"?value="新窗口打開網(wǎng)站"?onClick="openWindow()"/>
?</body>
</html>
2016-11-20
var?new=prompt("
這里不能用new作為變量名,new是js的關(guān)鍵詞,這里隨便換個名字便可以
2022-03-25
有啊,在視頻右下角選中事件,當文本框或者文本域中的文字被選中時,觸發(fā)onselect事件,同時調(diào)用的程序就會被執(zhí)行。仔細學(xué)習左側(cè)的基礎(chǔ)內(nèi)容