HutsAIO
HutsAIO

Reputation: 1

Execute a function on a site which is normally executed by clicking a button

I am trying to execute a function on a site which is normally executed by clicking the button, without clicking the actual button (so either through the console or another way)

site: https://clickthatbutton.com/

As you can see on the site once you click the button it adds a click to this sentence: "7 CLICKS FROM YOU... THANK YOU". I want to run the function that adds 1 click to that sentence without clicking the button or changing the number in elements.

Upvotes: 0

Views: 55

Answers (2)

Cohars
Cohars

Reputation: 4022

You first need to find the element you want to target, in this case the id is #submit. Then you can use the native function click() on it.

document.querySelector('#submit').click()

The website exoses Jquery but this can perfectly be done with native functions.

Upvotes: 0

mplungjan
mplungjan

Reputation: 178350

$("#click").submit()

from the console

Interestingly they should not have called the button "submit"

Upvotes: 1

Related Questions