浏览器编辑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:内细分下大 ...
随机推荐
- IOS的segmentedControl(分段器控件)的一些常用属性
#pragma mark - 创建不同的分段器 //初始化方法:传入的数组可以是字符串也可以是UIImage对象的图片数组 UISegmentedControl *mysegmented = [[UI ...
- JavaScript 学习笔记: 扩充类型的功能
JavaScript 是允许给基本类型扩充功能的.例如,可以通过对Object.prototype增加方法,可以让该方法对所有的对象都可用. 这样的方式对函数,数组,字符串,数字,正则表达式和布尔值同 ...
- 使用FOR循环语句在屏幕上输出一个由星号组成的直角三角形
题目要求: 请用C++的信息输出方式,使用循环语句在屏幕上输出一个由星号组成的直角三角形,形状如下: * ** *** **** ***** 要求: 完全使用C++的信息输出方式,即cout以及流插入 ...
- php封装文件上传
这是一个经常在项目中遇到的问题,所以封装一个,分享给大家. 一,前期配置php.ini 如果上传文件超过了php配置那么$_POST或者$_FILES等都是空数组,这点是一个坑,因为那时候就不 ...
- Shell/Bash 变量/variable 循环/loop
如何在bash脚本里面进行循环 #!/bin/bash n=9999 for(( i =1; i<=100;i++)) do /root/testProgram $n sleep 5 n=$(( ...
- 常用的 Internet Browser adds-on/浏览器插件
主要应用在Firefox, 或 Google Chrome 一.AdBlockPlus 广告屏蔽软件 二.GreaseMonkey 多样化网页 三.Dictionary.com 弹出单词的解释,来自 ...
- 谱曲软件-MuseScore
谱曲软件-MuseScore 参考: 1.MuseScore官网 2.免费乐谱制作软体MuseScore
- ueditor使用代码高亮的方法
最近发现ueditor支持代码高亮,但是页面上并没有起效果,于是网上找了下,发现还需做如下修改: 1.页面引用以下资源文件(均位于ueditor目录中): <script type=" ...
- 支付宝api教程,支付宝根据交易号自动充值
最近公司要用php做一个网站支付宝自动充值的功能,具体就是客户把钱直接转到公司的支付宝账号里,然后在我们网站上填写上交易号,我们网站程序自动获取交易信息,自动给网站的账户充值. 我的具体想法就是利用支 ...
- PHP递归
<?php /** * Mr.xml * 处理无限级分类 */ class Category{ /** * [递归一维数组] * @param [type] $cate [传递一个数组$cate ...