JSFiddle - React, Tailwind, and code Playground

by Purag Moumdjian

HTML

<textarea rows="10" cols="40" id="content">
</textarea>

<div id="fake">
    <img src="http://placehold.it/100x100">
    <img src="http://placehold.it/80x80">
    <img src="http://placehold.it/150x150">
</div>

CSS

#fake img {
    cursor:pointer;
}

JavaScript

$(function(){
    $("#fake img").click(function(){
        var update = $("<div>").append(
            $("<img>").attr("src", $(this).attr("src"))
        ).html();
        
        $("#content").val(function( i, v ) {
            return v + update; 
        });
    });
});