English
<!--There are two steps to achieve this effect. The first step is to put the following code in the <head> area--> <script> function runEx(cod1) { cod=document.all(cod1) var code=cod.value ; if (code!=""){ var newwin=window.open('','',''); //Open a window and assign it to variable newwin. newwin.opener = null //Prevent code from modifying the page newwin.document.write(code); //Write code into this open window, thus realizing the function of running code. newwin.document.close(); } } //Copy text field code function cycode(obj) { var rng = document.body.createTextRange(); rng.moveToElementText(obj); rng.scrollIntoView(); rng.select( ); rng.execCommand("Copy"); window.status="The code contained in the highlight has been copied to the clipboard! Contents highlighted and copied to clipboard!" setTimeout("window.status=''",1800) rng .collapse(false); } //Save code function svcode(obj) { var winname = window.open('', '_blank', 'top=10000'); winname.document.open('text/html', 'replace'); winname.document.writeln(obj.value); winname.document.execCommand('saveas','','code.htm'); winname.close(); } </script> <!- -The second step is to put the following code into the <body> area--> <TEXTAREA rows='12' cols='78' class='fm' id='code'> <!-- http://www .downcodes.com/bbs--> </TEXTAREA> <INPUT onclick="runEx('code')" type="button" value="Run code" style="cursor:hand"onFocus="this.blur( )"> <input type="button" name="Submit" value="Copy to clipboard" onClick="cycode(code)" style="cursor:hand;width:95px" onFocus="this.blur() "> <input type="button" value="Save code as" onclick="svcode(code)" style="cursor:hand" onFocus="this.blur()">