I am using textarea and I have binded propertychange event to it. Below is the code I used
$('#textareaID').bind('input propertychange', function() {});
But this event gets triggers only when changes happen to the textarea after the page loads. I want it to get triggered when page loads itself. Since on page load I am assigning a value where I want it to happen at that time. Is it possible to trigger at page load itself ?
I am using textarea and I have binded propertychange event to it. Below is the code I used
$('#textareaID').bind('input propertychange', function() {});
But this event gets triggers only when changes happen to the textarea after the page loads. I want it to get triggered when page loads itself. Since on page load I am assigning a value where I want it to happen at that time. Is it possible to trigger at page load itself ?
Share Improve this question edited Jul 6, 2012 at 4:28 Derek 朕會功夫 94.5k45 gold badges198 silver badges253 bronze badges asked Jul 6, 2012 at 4:23 LollyLolly 36.5k44 gold badges122 silver badges163 bronze badges 1- You have to wait at least until the DOM loads. – Derek 朕會功夫 Commented Jul 6, 2012 at 4:29
1 Answer
Reset to default 8Does triggering it manually work for you?
Example in jsFiddle: http://jsfiddle/VAT83/
$(function() {
var textValue = $('#textValue');
$('#textareaID')
.bind('input propertychange', function() {
textValue.html($(this).val());
})
.trigger('propertychange');
});