admin管理员组文章数量:1391999
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');
});
本文标签: javascriptpropertychange event to trigger on Page loadStack Overflow
版权声明:本文标题:javascript - propertychange event to trigger on Page load - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744686532a2619734.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论