此腳本打開一個輸入網站的新頁面。我怎麼操縱它出現在通過複選框的窗口?例如,如果檢查滾動條的複選框,我如何將它添加到新窗口?如何通過複選框將滾動條添加到新窗口?
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title></title>
<script>
function go(){
var myWindow;
var urlValue = document.getElementById("urlValue").value;
//radio buttons
if(yes.checked){
myWindow = window.open(urlValue);
}
else if (no.checked){
myWindow = window.open(urlValue, "_self");
}
//checkbox loop
/*
for (i=0; i<document.myForm.checkGroup.length; i++){
if (document.myForm.checkGroup[i].checked==true)
alert("Checkbox at index "+i+" is checked!")
}
*/
}
</script>
</head>
<body>
<form name="myForm">
<p><label>Enter URL with http:// here: </label> <input id="urlValue" type="text"></p>
<p><label>Would you like to open a new window?<br>
<input name="yesNo" id="yes" type="radio">Yes<br>
<input name="yesNo" id ="no" type="radio">No </label></p>
<p><label>Other Options</label> <br>
<input name = "checkGroup" id="fullScreen" type="checkbox">Full Screen<br>
<input name = "checkGroup" id="scrollBar" type="checkbox">Scroll Bar<br>
<input name = "checkGroup" id="statusBar" type="checkbox">Status Bar<br>
<input name = "checkGroup" id="toolBar" type="checkbox">Tool Bar<br>
</p>
<p><input id="goButton" value="GO" type="button" onclick = "go()"></p>
</form>
</body>
</html>