function submit_test(){
$('#editable').val($('#editable_div').html());
}
function submit_test2(){
$('#editable_div').html($('#editable').val());
}
</script>
<style>
.editable, .editable_div { width:600px; }
.editable { height:100px; }
.editable_div {
height: 200px;
border: 1px solid #ccc;
padding: 10px;
margin : 0 0 15px 0;
background: #cccccc;
box-shadow: 10px 10px 5px #888888;
}
</style>
<textarea id="editable" class="editable" ></textarea><br/>
<div id="editable_div" class="editable_div" contenteditable="true">
<img src="http://127.0.0.1/Docs/Images/utf-8/style1/logo02.png"><br/>
contenteditable 属性规定元素内容是否可编辑。
</div>
<a class="btn" href="#" onclick="document.execCommand('bold');">bolt</a>
<a class="btn" href="#" onclick="document.execCommand('italic');">italic</a>
<a class="btn" href="#" onclick="document.execCommand('underline');">underline</a>
<a class="btn" href="#" onclick="submit_test();">submit</a>
<a class="btn" href="#" onclick="submit_test2();">submit2</a>