Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[素材] [代碼]在線測試HTML代碼

[复制链接]
hungcheukhang 发表于 2012-7-27 16:45:45 | 显示全部楼层 |阅读模式
本帖最后由 hungcheukhang 于 2012-7-27 16:48 编辑

<script>
function runEx(){
var winEx2 = window.open("", "winEx2", "width=500,height=300,status=yes,menubar=no,scrollbars=yes,resizable=yes"); winEx2.document.open("text/html", "replace");
winEx2.document.write(unescape(event.srcElement.parentElement.children[0].value));
winEx2.document.close();
}
function saveFile()
{
var win=window.open('','','top=10000,left=10000');
win.document.write(document.all.asdf.innerText)
win.document.execCommand('SaveAs','','e:\\mb5u\\test.htm')
win.close();
}
function paste()
{asdf.focus()
document.execCommand("Paste")}
</script>
</head>
<div align="left">
<p>
<textarea name="textfield" id="asdf" style="width:90%;1px solid #999999';color:white;font-family:Verdana" rows="20" wrap="VIRTUAL">
</textarea>
<br>
<br>
<input type=button name=Button value=運行代碼 onClick=runEx()>
<input type=button name=Button value=粘貼 onClick=paste()>
<input type=button name=Button value=全選 onClick=asdf.select()>
<input type=button name=Button value=清空>
<input type=button value='保存代碼'>
</div>
</body>
</html>
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-10-2 00:31 , Processed in 0.181945 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表