Search code examples
javascriptgreasemonkey

Greasemonkey button click


Can anyone please help me with clicking this button using greasemonkey? http://mibpaste.com/te6fRR (Full Source)


Solution

  • var evt = document.createEvent ("HTMLEvents");
    evt.initEvent ("click", true, true);
    document.getElementById('fight_btn').dispatchEvent (evt);
    

    See: http://wiki.greasespot.net/Generate_Click_Events