When I use method click() to click the button, the submission failed.
But, when I use the mouse to click the button on that webpage, (the submit form is same) it works.
HTML file:
<button xmlns="http://www.w3.org/1999/xhtml" class="ui-button button1" type="submit" id="create">
<span>
<span>Create</span>
</span>
</button>
My userscript file:
document.getElementById("create").click();
How do I click the button using HTML DOM click()?
maybe instead of clicking the button. You can submit the form in javascript as
document.getElementByName('form1').submit();
as it fulfills your requirement.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With