javascript - Auto click button script for tampermonkey? -
am trying create user script click following button possible on loadiing page. <button class="btn" tabindex="10" disabled="disabled" onclick="validateandsubmit('1')" title="" pay-tab="1">do now</*button> please trying long time failing so. i tried this: <script type="text/javascript"> settimeout(function() { document.getelementbyid("btn").click(); },1000); </script> try this (function() { window.addeventlistener('load', validateandsubmit('1'), false); })(); (function() {})() defines scope self executed without waiting events. window.addeventlistener('load', validateandsubmit('1'), false); subscribes function validateandsubmit window load event function executed on load. same function trying execute clicking button.