DEV Community

Jordan Kicklighter
Jordan Kicklighter

Posted on

3

Quick Tip: Disable Button On Click

In a world full of JS frameworks and templating languages, there's still occasionally a need to write very simple pages. With a habit of leaning into Vue, React, etc. it can be easy to forget the basics when we don't need anything flashy.

Here's a tiny snippet to disable a button when it's clicked without the need for any extra JS scripts. It only takes a few words in an onclick attribute. Could be useful if you have some basic HTML form that submits on a button press.

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up