日期:2014-05-16 浏览次数:20328 次
<div id="editer" contentEditable="true" style="border:1px solid #ccc;width:400px;height:200px" >
123456<br/>123456
</div>
<button onclick="InsertImage()">InsertImage</button>
<script language="javascript">
var editer=document.getElementById('editer');
function InsertImage(){
ImagePath = window.prompt('图片URL:', '');
editer.focus();
document.execCommand('InsertImage', false, ImagePath);
}
</script>