javascript/jquery trigger a text change event on a textarea
Is there anyway to trigger the textChanged event in a text area using javascript or jquery ?
I want the textchange event to occur once 开发者_StackOverflow中文版the page is loaded.
$(document).ready(function() {
$('textarea').trigger('change');
});
But this will only trigger if the change event was added through jQuery. If not you could try:
$('textarea').get(0).change();
Have you tried:
$(function(){
$("textarea").change()
})
In my case, I have to use the event input
since my textarea used as emoji field.
For ex.
$('textarea').trigger('input');
精彩评论