How do I click on this button with Greasemonkey?

后端 未结 2 1461
轻奢々
轻奢々 2020-11-29 12:54

I\'m a total newbie with JS, and I\'m trying to click on this button:

find
         


        
2条回答
  •  被撕碎了的回忆
    2020-11-29 13:19

    You need to use the method click rather than submit. You can use submit when you want to submit a form.

    getElementsByClassName also returns an array of elements, you need to retrieve the one you want and then call click on it.

    document.getElementsByClassName('simplebutton')[0].click();​
    

    http://jsfiddle.net/kLDde/

提交回复
热议问题