Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我设置一个输入变量
input.value = 'Something';
我知道我可以通过触发更新 angularjs
$(input).trigger('input');
我可以使用常规 Javascript 触发相同的事件吗?不使用jQuery?
是的,你可以做到。尝试这个:
document.getElementsByTagName("input")[0].value = "Something";