r/JavaScriptTips • • Sep 29 '21

Need help to use JavaScript to click submit button (without ID)

Need help to use JavaScript to click submit button (without ID), I try this but does not work :

docuement.querySelector('input[type*="submit"]').submit();

the form link is here:

https://docs.google.com/forms/d/e/1FAIpQLSfQiOnXWDwgBWtDu4kQKEFHM5XiZ5Sxb2bKfrp31BxpQKLbBQ/viewform

Hope someone can help me with the Javascript. Thanks

1 Upvotes

3 comments sorted by

1

u/ScootMcBoot Sep 29 '21

Something like this might work:

document.querySelector('div[class*="LeftButtons"] div[role="button"]').click()

1

u/sgmike0297 Sep 29 '21

Cannot work .

0

u/[deleted] Sep 29 '21

[deleted]

1

u/sgmike0297 Sep 29 '21

Check with correct “ document” but script still cannot work