
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
enable-buttons
Advanced tools
Automatically enable/disable buttons based on required form inputs
Automatically enable/disable buttons based on required form inputs
npm install enable-buttons
<form class="js-enable-buttons">
<input type="text" name="hello" required>
<button type="submit" disabled>
Submit
</button>
</form>
import enableButtons from 'enable-buttons'
enableButtons()
The enableButtons
function can take an object, that
may include the following properties.
The class name that Enable Buttons uses to locate sections.
Defaults to js-enable-buttons
.
enableButtons({ className: 'my-special-class' })
If there is a button that you don't want Enable Buttons to
do it's magic on, then you can add the data-ignore
attribute to it.
<form class="js-enable-buttons">
<input type="text" name="hello" required>
<button type="submit" disabled>
Submit
</button>
<button type="button" data-ignore="true">
Don't touch me
</button>
</form>
Enable Buttons is packaged with Babel, and
makes use of Array.from
.
If you want Enable Buttons to work on browsers that don't support
this method (e.g. IE11), then you will need to
polyfill Array.from
before calling enableButtons
.
FAQs
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.