開啟視窗並寫入文字
document.write()
document.open()
document.close()
可開啟視窗並寫入文字
程式碼如下:
<script>
function Event1(){
//create a blank window
var w1 = window.open("", "mywin");
//open that to write
w1.document.open();
w1.document.write("This is first line");
w1.document.close();
}
</script>
<input type="button" value="Press to start" onclick="Event1()">