【发布时间】:2010-07-08 10:36:56
【问题描述】:
$(document).ready(function() {
$('#text').live('change', function() {
alert('hello');
});
$('#button').live('click', function() {
$('#text').val('some text');
});
});
<div>
<input type="button" id="button" value="Click Me" />
<input type="text" id="text" />
</div>
如何在单击按钮时触发文本框上的change 函数?
【问题讨论】:
标签: jquery input textbox onchange jquery-events