Today, in the middle of a comment function like qq, I had no idea what to do, searched the Internet for answers, and finally I was enlightened in a small, small corner.
The HTML code is as follows:
<div id="guo" style="width:500px; height:200px; border:1px solid red" contenteditable="true">
<img src="qqface/1.gif" />
</div>
<input type="button" value=" insert " onclick="insert()" />
Js code:
function insert() {
$("#guo").append("<img src='qqface/2.gif' />");
}
Interface before operation:
Click the interface after insertion:
Input text, and the inserted image can be copied from one input box to another
Call it a day.