网站简介:提供div+css网站标准化重构技术学习教程资料下载 其中包括:float,padding,margin,position,background等的使用方法
当前位置:Web标准化 >> 常用代码 >> 正文

最简单的在线编辑器

2007年03月30日 来源:本站原创 浏览次数: 字号:[ ]

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title> 最简单的在线编辑器 </title>
<style>
body{font-size:12px;}
#edit,#view{border:1px solid red;width:100%;height:200px;overflow-y:auto;margin-bottom:10px;}
#view{border-color:#ddd;}
</style>
</head>

<body>
最简单的在线编辑器, only for ie
<div id="edit" contenteditable="true">
编辑区
</div>

<input type="button" value="查看代码↓" onclick="document.getElementById('view').value=document.getElementById('edit').innerHTML">

<input type="button" value="更新编辑区↑" onclick="document.getElementById('edit').innerHTML=document.getElementById('view').value">

<textarea id="view">
代码区
</textarea>
</body>
</html>

contentEditable="true"
?
?