How to Automate Clicks Using JavaScript

Because using the mouse is so last year

Thomas Molnar-Brock
The Startup

--

Dated Computer Mouse
Image Credit: @shagal_sajid on Unsplash

If you are like me, you probably use a computer at least once a day. Maybe even several. Of the time you spend on your computer, I’m willing to wager that a large portion is spent online. Of that time, quite a lot might be spent clicking on stuff. This guide will show you how to click in an easier, less repetitive way, which can be easily customized to your precise clicking needs.

Step One: Fire Up Google Chrome

I will demonstrate this by creating a simple function to click a button on this website I built, but you should be able to use the idea we are working on for a wide-variety of custom-clicking tasks.

The first thing to do is to open your Chrome browser. Then, navigate to a website on which you want to click the same button multiple times.

Step Two: Gain Access to The Mainframe (Well Actually Just The JS Console)

Open the console by right-clicking the element you wish to automate clicks for and selecting the inspect option. You should see a lot of highlighted lines of HyperText Markup Language (HTML).

--

--

Thomas Molnar-Brock
The Startup

I like to write about technology and personal growth.