jmadler / emoji-picker

Add a slick emoji selector to input fields and textareas on your website.
Other
1.31k stars 318 forks source link

How to set value to the textarea using javasctipt #119

Open kickbox opened 6 years ago

kickbox commented 6 years ago

I want to dynamically pass different values to the textarea. But when I pass the values to the textarea, nothing changes in the frontend.

Is there some kind of binder between the original textarea and the div element(created by emojij-picker)?

plonknimbuzz commented 5 years ago

same here. $('input').va(111) nothing changes.

or maybe , how to destroy existing emojiarea so i can set value and recreate it.

nonozor commented 5 years ago

The value is changed but not the display.. how can we refresh it ?

AmagiTech commented 4 years ago

i am using this function function setEmojiInput(id, val) { var inp = document.getElementById(id); var divCont = inp.nextElementSibling; inp.value = val; divCont.innerHTML = val; }

edwincarnese commented 3 years ago

You can also do it using jQuery Set both values on textarea field and emoji picker field: $('#textarea-id').val(value); $('#textarea-id').next().html(value);