[英]How can I make the onchange event work for the text input box update by the javascript/Jquery?
Does anyone know how can I make the onchange event work for the text input box update by the javascript/Jquery?有谁知道如何使 onchange 事件对 javascript/Jquery 的文本输入框更新起作用?
Example:例子:
Instead of manually key in the text into the input box, I will insert the value into the text box by using jquery as below.我将使用 jquery 将值插入到文本框中,而不是手动将文本输入到输入框中,如下所示。 Any way that the onchange event will work once the value been change in the text box by jquery?
一旦jquery在文本框中更改值,onchange事件将以任何方式工作? Any way I can make it work?
有什么办法可以让它工作吗?
HTML: HTML:
<table>
<tr>
<td>
<input type="text" ID="test" />
</td>
</tr>
</table>
Javascript: Javascript:
$(".test").val("ABC");
$('.test').change(function () {
alert('hello')
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.