JS、HTML代码运行工具 <!-- function copyCode(obj) { if(obj.value==""){ alert("请输入要复制的代码内容"); return false;} var rng = document.body.createTextRange(); rng.moveToElementText(obj); rng.scrollIntoView(); rng.select(); rng.execCommand("Copy"); rng.collapse(false); } <P>function runCode(obj) { if(obj.value==""){ alert("请输入要运行的代码内容"); return false;} var winname = window.open('', "_blank", ''); winname.document.open('text/html', 'replace'); winname.document.writeln(obj.value); winname.document.close(); } <P>function saveCode(obj) { if(obj.value==""){ alert("请输入要保存的代码内容"); return false;} var winname = window.open('', '_blank', ''); winname.document.open('text/html', 'replace'); winname.document.writeln(obj.value); winname.document.close(); winname.document.execCommand('saveas','','savecode.htm'); winname.close(); } //--> JS、HTML脚本运行工具 [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]