mervick / emojionearea

Emoji Picker Plugin for jQuery
https://jsfiddle.net/mervick/1v03Lqnu/765/
MIT License
953 stars 257 forks source link

textarea not getting emptied on submit #447

Closed dani3l3 closed 2 years ago

dani3l3 commented 2 years ago

Hi there, most likely I am doing something wrong... I have the following:

`

                        </div>`

and then in JS I load emojionearea on the textarea:

$(".message-input").emojioneArea({ placeholder: "Scrivi un messaggio...", searchPlaceholder: "Search" });

then I have a handler for the button click

// send message $(".send-btn").on('click', function(){ var message = $(".message-input").val();

...then other non relevant code that sends the message... ...once it's sent, I attempt to clean up the textarea:

$(".message-input").val(""); }

which was working before I added emojionearea.... BUT since I bound emojionearea to the textarea, the .val("") seems to do nothing anymore....

Any idea?

dani3l3 commented 2 years ago

I answer myself:

$('.emojionearea-editor').text("");