当前位置:开发者网络 >> 网页特效 >> 综 合 类 >> 内容
精彩推荐
分类最新特效
分类热点特效
  
都是对textarea框的操作,可以看源代码,也可执行代码等
日期:2005-07-01   人气:   【字体: 】【收藏此文


<!-- 网页特效代码由[中国WEB开发者网络:http://www.ChinaWebDev.com]提供! -->
<!-- 要实现此效果需要 1 个步骤: -->

<!-- 第 1 步: -->
<!-- 把下面的代码加到<BODY></BODY>区域中: -->

<textarea id=code cols=50 rows=5></textarea><br>
<button onclick=Preview()>调试代码</button>
<button onclick='code.value=""'>清空内容</button>
<button onclick='code.select()'>全选内容</button>
<button onclick='code.value=document.documentElement.outerHTML'>查看源代码</button>
<script>
function Preview()
{
var TestWin=open('','','');
TestWin.document.open('text/html','replace');
TestWin.document.write(code.value);
TestWin.document.close();
}
</script>