62,074
社区成员
发帖
与我相关
我的任务
分享
<textarea autocomplete="off" class="code_input" id="textareaCode" wrap="logical" rows="30" cols="50"><!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
</textarea>
然而显示html内容页面也就是右边的页面是
<textarea autocomplete="off" class="code_input" id="textareaCode" wrap="logical" rows="30" cols="50"><!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
</textarea>
<title>所见即所得</title>
<style type="text/css">
.box
{
width:500px;
height:300px;
border-style:solid;
border-color:#000;
border-width:1px;
}
</style>
</head>
<textarea id="code" class="box" onkeyup="coding();"></textarea>
<div id="show" class="box"></div>
<script type="text/javascript">
function coding(){
document.getElementById("show").innerHTML = document.getElementById("code").value;
}
</script>
<body>