<html> <body> <script> function runCode(obj) { obj = typeof obj == "string" ? document.getElementById(obj) : obj; var winname = window.open('', "_blank", ''); winname.document.open('text/html', 'replace'); winname.document.write(obj.innerHTML); winname.document.close(); } </script> <div id='abc'><font color="#f00" >123456</font></div> <button onclick="runCode('abc')">preview</button> </body> </html>
|
|