I want to insert an image in textarea with jquery. (I know that img tag could not to inserted in textarea). Im using tinymce
<img src="image.jpg" class="po"/>
<form>
<input type="text" name="yassi" class="infobox"/>
<br />
<textarea class="me"></textarea>
<input type="submit" value="click" class="submit"/>
</form>
jquery:
<script type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "simple"
});
</script>
<script type="text/javascript" scr="config.js">
</script>
and in config.js I have:
$(document).ready(function(){
var sr = $('.po').attr('src');
$('.po').click(function(){
$('.mceContentBody').append('<img src="'+sr+'"/>');
});});
When clicking, image couldnt insert in textarea. How can do this? Thanks in advance.