更新时间:2023-01-25 08:38:31
您可以在通过更改值后使用 document.getElementById("txt").onchange();
从代码中触发 onchange代码
you can fire onchange from code using document.getElementById("txt").onchange();
after the changing the value through code
更新
更改您的 set 函数以获取文本框的 id
change your set function to take the id of the text box
function set(textboxid)
{
var tb = document.getElementById(textboxid);
tb.value++;
tb.onchange();
}