I'm making the chat app in phone-gap, and I want to insert similes, I've inserted the similes from text area and it is being shown in body, but the issue is that when I click on similes form text area it is showing the whole path instead of title like for laughing we write :D and it shows laughing similes. When I click on laughing it shows the whole path of image but not :D (which I want). Here is my code:
<textarea name="txtmessage" style=" width: 82%; height: auto; outline-color: none;" id="txtmessage" placeholder="write your text here..."></textarea>
<div class="em">
<img src="http://simpleicon.com/wp-content/uploads/big-smile-256x256.png" width="25" id="showhide_emobox" />
<div id="emobox">
<img alt=":)" border="0" src="emotions/emoticon-happy.png" />
<img alt=":(" border="0" src="emotions/emoticon-unhappy.png" />
<img alt=":o" border="0" src="emotions/emoticon-surprised.png" />
</div>
</div>
$('#emobox img').live("click",function () {
var smiley = $(this).attr('alt');
var test = $(this).attr('src');
var tst1 = '<img alt=' + smiley + ' border=0 src=' + test + ' />'
ins2pos(tst1, 'txtmessage');
});