标签:pen wpa fun button text value utf-8 win type
<meta charset=‘utf-8‘><textarea id=‘txt‘ rows=‘30‘ cols=‘110‘></textarea>
<input type="button" id=‘btn‘ value="运行">
<script>
var btn = document.getElementById(‘btn‘),
txt = document.getElementById(‘txt‘);
btn.onclick = function () {
//open是有返回值的,返回值就是新打开的窗口
var newPage = window.open(‘newPage‘);
//再往新窗口里写内容
newPage.document.write(txt.value);
}
标签:pen wpa fun button text value utf-8 win type
原文地址:http://blog.51cto.com/11123779/2160295