What is the best way to simulate a user entering text in a text input box in JS and/or jQuery?(模拟用户在JS和/或jQuery中的文本输入框中输入文本的最佳方法是什么?)
I don't want to actually put text in the input box, I just want to trigger all the event handlers that would normally get triggered by a user typing info into a input box.(我不想居然把文本输入框,我只是想触发所有的事件处理程序 ,通常会得到用户输入信息到一个输入框触发。) This means focus, keydown, keypress, keyup, and blur.(这意味着聚焦,按下键,按下键,按下键和模糊。) I think.(我认为。)
So how would one accomplish this?(那么,一个人如何做到这一点呢?)
ask by Alex translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…