There ist a Form and Input without a button. You can send a message by typing Enter. The Form has an id.
Is it possible to trigger or kinda faking the Enter-Key only with JavaScript? (No jQuery, because the Page has already loaded).
I tried:
e = jQuery.Event("keypress");
e.which = 13; //choose the one you want
document.querySelector("gui.frm_chat.tabs.tab_6.text.input#main").keypress().trigger(e);
But it didn't have jQuery.
CodePudding user response:
I think form.submit() is what you are looking for:
https://www.w3schools.com/jsref/met_form_submit.asp
CodePudding user response:
I guess the better solution is form.requestSubmit(): https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/requestSubmit

