浏览器编辑HTML
运行效果:
浏览器编辑HTML
test.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- 不想写开头,点击此处参考一下HTML开头吧!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- 如有疑问,可直接访问:追梦人...博客首页
HTML源码:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>浏览器编辑HTML</title>
<script language="JavaScript" type="text/JavaScript">
//运行文本域代码
function runEx(cod1) {
cod=document.all(cod1)
var code=cod.value;
if(code==""){
alert('内容为空,请输入内容!');
}
if (code!=""){
var newwin=window.open('','',''); //打开一个窗口并赋给变量newwin。
newwin.opener = null // 防止代码对论谈页面修改
newwin.document.write(code); //向这个打开的窗口中写入代码code,这样就实现了运行代码功能。
newwin.document.close();
}
}
function quickdelete(cod2){
cod=document.all(cod2)
var code=cod.value;
if(code==""){
alert('无需重复点击,内容已经为空!');
}
document.getElementById(cod2).value ="";
}
</script>
<style type="text/css">
.boxes{
text-align: left;
font-size: 18px;
width: 1150px;
height: 400px;
color: #4d90fe;
font-weight: bold;
margin-left: 100px;
background: #f3f7fc;
border: 1px solid #4d90fe;
border-radius: 3px 3px 3px 3px;
}
.boxes2{
text-align: left;
font-size: 18px;
width: 1150px;
height: 300px;
color: #4d90fe;
font-weight: bold;
margin-left: 100px;
background: #f3f7fc;
border: 1px solid #4d90fe;
border-radius: 3px 3px 3px 3px;
}
.run_btn {
border-radius: 3px 3px 3px 3px;
background: #4d90fe;
border: 1px solid #4d90fe;
display: inline-block;
vertical-align: middle;
color: #f3f7fc;
font-weight: bold;
width: 100px;
font-size: 18px;
height: 41px;
cursor: hand;
}
.run_btn:hover{background:#1874CD} .delete_btn{
border-radius: 3px 3px 3px 3px;
background: #F0CB85;
border: 1px solid #F0CB85;
cursor: pointer;
display: inline-block;
vertical-align: middle;
color: #DC143C;
font-weight: bold;
width: 100px;
font-size: 18px;
height: 41px;
}
.delete_btn:hover{background:#DEB887} .cen{
text-align: center;
} *{
margin: 0;
padding: 0;
} li{
background: #EEE;
line-height: 24px;
display: block;
position: relative;
color:red;
} li a{
line-height: 24px;
display: block;
color: red;
margin-left: 20px;
text-align: center;
} li a:hover{
color: red;
} ul li input[type="checkbox"]{
position: absolute;
top: 0;
width: 100%;
height: 24px;
opacity: 0;
cursor: hand;
} ul li input[type="checkbox"]:not(:checked) + ul {
display: none;
cursor: hand;
} #text{
font-size:20px;
margin-left:200px;
color:red;
cursor: hand;
} </style>
</head>
<body background="http://images2015.cnblogs.com/blog/512541/201511/512541-20151124231305937-1592292858.jpg" bgproperties="fixed" style="background: #f3f7fc;"
>
<p style="text-align: center;color: blue;font-weight: bold;">test.html</p>
<textarea class="boxes" name="textarea" cols="100" rows="26" id="rn01">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>浏览器HTML运行</title>
</head>
<body> <h1>请输入你想要输入的内容</h1>
<p>内容最好不要为空,否则没有显示效果</p> </body>
</html>
</textarea>
<hr />
<form class="cen">
<input class="run_btn" onClick="runEx('rn01')" type="button" value="运行代码">
<input class="delete_btn" onClick="quickdelete('rn01')" type="button" value="清空代码">
</form>
<ul>
<li><a>不想写开头,参考一下HTML开头吧!</a>
<input type="checkbox" name="list" />
<ul>
<li>
<textarea class="boxes2">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Document</title>
</head>
<body> <h1>请输入你想要输入的内容</h1>
<p>内容最好不要为空,否则没有显示效果</p> </body>
</html>
</textarea>
</li>
<li><a href="http://www.cnblogs.com/tufujie" target="_blank" title="点击进入追梦人...博客首页">如有疑问,可直接访问:追梦人...博客首页</a></li>
</ul>
</li>
</ul>
</body>
</html>
浏览器编辑HTML的更多相关文章
- 浏览器编辑web页面的方法
F12打开控制台执行 document.body.contentEditable='true'; 这样就可以随便修改了
- 在线office文档编辑NTKO使用心得
目录 前言 什么是ntko 准备工作 实战演练 总结 一.前言 Web开发中经常需要用到在线处理office文档的功能,现在市面上有一些常用的Web页面调用显示Office的控件技术,用起来很方便.有 ...
- 关于Anaconda安装以后使用Jupyter Notebook无法直接打开浏览器的解决方法
关于Anaconda安装以后使用Jupyter Notebook无法直接打开浏览器的解决方法 1.首先打开Anoconda Prompt,输入命令 jupyter notebook --generat ...
- 使用Word发表博客
使用浏览器编辑博客,会让你感到非常不方便,如果在没有网络的时候,就不能打开编辑器页面了,只能先写在word或其他编辑软件中.可以设置word使用word编辑并直接发布到博客. 文件 - 新 ...
- JAVA上百实例源码以及开源项目
简介 笔者当初为了学习JAVA,收集了很多经典源码,源码难易程度分为初级.中级.高级等,详情看源码列表,需要的可以直接下载! 这些源码反映了那时那景笔者对未来的盲目,对代码的热情.执着,对IT的憧憬. ...
- editplus快捷键大全其他editplus快捷键
editplus快捷键大全其他editplus快捷键,更多快捷键请参考以下文章:editplus快捷键大全之editplus搜索快捷键 editplus快捷键大全之editplus编辑快捷键 edit ...
- editplus快捷键大全
Eclipse快捷键 10个最有用的快捷键 1. ctrl+shift+r:打开资源 ctrl+b编译 ctrl+d删除 2. ctrl+o:快速outline --->这个是查看一个类中的用 ...
- linux samba.tar.gz安装和配置
安装步骤: 1. tar -xzvf samba-3.5.10.tar.gz2. cd samba-3.5.103. cd source34. ./autogen.sh 如果出现:./autogen ...
- 初步接触html心得
接触HTML大概有七天,做一下小总结,过过记忆. html大致可分为三部分:Dtd头.Head.Body三大部分. Dtd头:是用于浏览器编辑的,也就是俗话说的给电脑看的的东西. Head:内细分下大 ...
随机推荐
- 基于微软EnterpriseLib的框架(一)
1.框架模型无ORM,重点在数据库建模设计与UI框架设计上 2.多数据库支持(Enterprise Lib 默认仅支持SqlServer和Oracle,需自己扩展才能支持其他数据库,本文已扩展SQLi ...
- Eclipse查看历史代码
选中要查看的文件(.class等) 右击->Team->Show Local History
- Codevs 1001 舒适的路线 2006年 NOIP全国联赛提高组
1001 舒适的路线 2006年 时间限制: 2 s 空间限制: 128000 KB 题目等级 : 钻石 Diamond 题目描述 Description Z小镇是一个景色宜人的地方,吸引来自各地的观 ...
- mysql学习笔记3
要用php+mysql 首先要配置环境.现在要先下载wamp(Windows下的Apache+Mysql/MariaDB+Perl/PHP/Python).直接安装就行 可以点下一步的就点下一步,直至 ...
- HTML5之地理信息应用 获取自己的位置
上代码: window.onload = function() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosit ...
- mysql远程访问的权限
1.改表法 mysql>use mysql; mysql>update user set host = '%' where user = 'root'; 2.授权法 例如,你想myuser ...
- SQL技巧之排名统计
有一道SQL笔试题是这样子的: 已知表信息如下: Department(depID, depName),depID 系编号,DepName系名 Student(stuID, name, depID) ...
- MAC 上找不到.bash_profile或者ect/profile该怎么办?
开发Android的环境要重新在Mac上搭建,结果在配置环境变量时找不到.bash_profile文件.查过很多资料解决方案都很笼统,结果还是在英文网站上找到解决方法. 1. 启动终端Termin ...
- Python 守护进程
import os import sys from time import sleep try: pid = os.fork() if pid > 0: sys.exit(0) # Exit p ...
- Razor语法小记
1.代码块中,<text>标签用来输出,如: @{ <text>sdfsdf</text> } 输出Html: sdfsdf