I want to ask about add image into textview or input type text with jquery library. As you can see at image above, emoji one area plugin can add an image of emoticon into textview, but i don't know how to do that. Anyone can tell me ?? Thank.
Asked
Active
Viewed 253 times
2 Answers
1
Maybe you're looking for something like HTML : Is there any way to show images in a textarea??
You can use div
elements as textarea
.
Nice example is here: https://codepen.io/andrewfiorillo/pen/wgmnB.

ghchoi
- 4,812
- 4
- 30
- 53
-
Thank for your answer, i seen on your link that imposible to do it. Right ? If i use div, they said about xss. Do you any idea to add image into textview not div ? – user8455694 Aug 30 '17 at 16:44
-
@user8455694 Check here: https://codepen.io/andrewfiorillo/pen/wgmnB. `textarea` is for text. If you add some emojis and inspect pages, you can see `img` elements in the `div` (as `textarea`) element. If you put `img` tag into `textarea` elements, HTML source itselt will appear. haha. – ghchoi Aug 30 '17 at 17:27
0
Instead of using textarea use a div and add contenteditable="true" tag, then it will act as both editable element and also as a div element, then you can append image tags (smileys) to it dynamically using jQuery

Ananthakrishnan Baji
- 1,254
- 1
- 9
- 21