Home >Web Front-end >JS Tutorial >TEXT text box that can insert pictures_javascript skills

TEXT text box that can insert pictures_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-16 17:06:351997browse

Today, when I was working on a comment function similar to that of QQ, I was at a loss and looked for answers everywhere on the Internet. Finally, I was inspired in a very small corner. I got to know a new thing, contenteditable.

The html code is as follows:

Copy code The code is as follows:




< ;input type="button" value="Insert" onclick="insert()" />

js code:

Copy code The code is as follows:

function insert() {
   $("# guo").append("");
        }

Interface before operation:

TEXT text box that can insert pictures_javascript skills

Interface after clicking insert:

TEXT text box that can insert pictures_javascript skills

Enter text, and the inserted image can also be copied from one input box to another

TEXT text box that can insert pictures_javascript skills

Call it done.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn