作者:chajian005_844 | 来源:互联网 | 2022-10-11 08:03
首先定义个文本域并且给个ID
然后定义个按钮
最后当然是要写函数了,代码如下:
代码如下:
function runCode(id){
var obj=document.getElementById(id);
var win = window.open('', "_blank", '');
win.document.open('text/html', 'replace');
win.opener = null;
win.document.write(obj.value);
win.document.close();
}