演示:
<div>欢迎订阅李明博客:<a href="https://www.blogs.hk" kesrc="https://www.blogs.hk">https://www.blogs.hk</a></div>
代码在线操作代码:
<p class="MsoNormal"><textarea style="width:679px;height:94px;" cols="50" rows="15" name="code" class="c-sharp"> <style> .button { border:1px solid #b1b4cd; background:#696d81; color:#ffffff; height:25px; line-height:25px; } </style> <script language="javascript"> function runCode(obj){ var bb=window.open('', "_blank", ''); bb.document.open('text/html', 'replace'); bb.opener = null; // 防止代码对页面修改 var obj=document.getElementById(obj); bb.document.write(obj.value); bb.document.close(); } function copycode(obj) { var obj=document.getElementById(obj); obj.select(); document.execCommand("copy"); } function saveCode(obj) { var obj=document.getElementById(obj); document.write(obj.value); document.close(); document.execCommand("saveAs",0,"nuodou_com_test.htm"); } </script> <textarea id="code" cols=80 rows=15>加上你的代码</textarea> <br /><br /> <input type="button" onclick='javascript:runCode("code")' value="运行代码" class="button"> <input type="button" onclick='javascript:copycode("code")' value="复制代码" class="button"> <input type="button" onclick='javascript:saveCode("code")' value="另存代码" class="button"> <br /><br /> </textarea> </p>
相关阅读
留言咨询