html编辑在线预览的代码小工具

<div class=“biaoti“>你好,欢迎你,代码在下面</div><style type=“text/css“>

.html_Test_title{

font-size:1.1em;

background:#abc;

border-top:1px solid green;

border-bottom:1px solid green;

padding:5px 6px;

margin:3px 1px;

display:block;

}

.html_Test_ts{

color:green;

font-size:0.9em;

}

</style>

<script>

function trestart(){

if (html_Test) {

clear = confirm(“确定要清除吗?“,‘‘);

if(clear) {

document.html_Test.reset();

document.html_Test.value = ““;

}

}

function test(){

{

temp = document.html_Test.tester.value;

testwin= open(““, “testwin“,“status=no,menubar=yes,toolbar=no“);

testwin.document.open();

testwin.document.write(temp);

testwin.document.close();

}

}

function about(){

alert(“本功能支持在线即时预览html代码“)

}

function help(){ 

OpenWindow=window.open(““, “newwin“,“height=220,width=470,toolbar=no,scrollbars=“+scroll+“,menubar=no“);

OpenWindow.document.write(“<body bgcolor=‘white‘ text=‘black‘ alink=‘blue‘vlink=‘blue‘ link=‘blue‘><title>帮助信息</title>“)

OpenWindow.document.write(“<center>你只要把你想显示的代码放到上页的输入框中,你自己也可以写代码,按显示键就能显示你的页面内容</center><br>“)

OpenWindow.document.write(“<center><a href=‘mailto:87003056@163.com‘ target=‘main‘>写信给我</a></Center><br>“)

OpenWindow.document.write(“<center><a href=‘javascript:close()‘>关闭本窗口</a></Center>“)

OpenWindow.document.close()

self.name=“main“

}

</script> 

<div class=“html_Test“>

<span class=“html_Test_title“>HTML代码预览</span>

<span class=“html_Test_ts“>请在下面输入框中输入html代码</span>

<form name=“html_Test“>

<textarea name=“tester“ wrap=“off“ rows=“8“ style=“width:80%;“>

</textarea>

<br>

<input οnclick=“test()“ type=“button“ value=“显示“> <input οnclick=“trestart()“ type=“button“ value=“清除“> <input οnclick=“about()“ type=“button“ value=“关于“> <input οnclick=“help()“ type=“button“ value=“帮助“> 

</form></div>

转载于:https://my.oschina.net/joyes/blog/316506

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值