I am trying to insert the emoji(s) into my input field called #usermsg
when it is clicked.
The emoji does not show up in the input field.
I have added .clone()
to the jQuery function so that the emoji would not disappear when clicked.
HTML emoji:
<a id="smiley" title="smiley" href="#" >😃</a>
HTML input field:
<input name="usermsg" type="text" id="usermsg"/>
jQuery function:
//Add emoji when clicked
$("#smiley").click(function(){
$('#smiley').clone().append('#usermsg');
});
I've tried adding .val();
after the .append('#usermsg');
However this still does not work for me.
If someone could lead me in the right direction.
Thank you.