要通过javascript函数调用enter键吗

要通过javascript函数调用enter键吗,javascript,Javascript,要通过javascript函数自动调用enter键: 例如: 你想完成什么?提交表格?插入换行符?也许有更好的方法可以做到这一点。看看其中的一个:简而言之,你做不到。根据你的真正目标,你必须找到一些解决办法。 document.getElementById("sd").focus();//set focus in a text box //then call enter key press event using java script var e= window.event// of ty

要通过javascript函数自动调用enter键:

例如:


你想完成什么?提交表格?插入换行符?也许有更好的方法可以做到这一点。看看其中的一个:简而言之,你做不到。根据你的真正目标,你必须找到一些解决办法。
document.getElementById("sd").focus();//set focus in a text box
//then call enter key press event using java script

 var e= window.event// of type keypress
e.keyCode=13;

//and execute the manualy created event e.