1
私はチャットで顔文字のクリック機能を書いています。私がそれをクリックすると、私のテキストエリアに追加されます。私はチャットにそれを送信したいテキストエリアから。Jqueryはappend function chatをクリックします。
jqueryの私が書いたもの:
$(".emoticon i").click(function() {
var e = $(this);
// $(".message").append ($(this).data('emoticon'));
console.log($(this).data('emoticon'));
$("#message").append() .attr(value('emoticon i'));
})。
<div class="emoji hidden">
<div class="emoticon-box">
<div class="emoticons">
<div class="emoticon">
<div class="row">
<i class="em em-smiley"></i>
<i class="em em-smile"></i>
<i class="em em-blush"></i>
<i class="em em-relieved"></i>
<i class="em em-kissing_closed_eyes"></i>
<i class="em em-neutral_face"></i>
<i class="em em-sleeping"></i>
<i class="em em-flushed"></i>
</div>`enter code here`
Hex of my texarea。
<input id="message" type="text" placeholder="Type your message"></input>
あなたは$( "em")を試しましたか?$( "。emoticon i")の代わりにclick() – mayk