1.0.0 • Published 4 years ago

input-toggle-js v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

toggle.js

A simple JavaScript input toggle control.

NPM

You can install directly via NPM to your project folder.

npm install toggle-js

CDN

The CDN is updated after the release is made public. Always, check the GitHub page for the latest release.

Usage

Add a toggle control to your web pages easily by simply including an input element with type attribute as toggle like so:

<input type="toggle">

States (On & Off)

The default state for the toggle is Off (0). You can also set a default state by adding a value to the value attribute like so.

<input type="toggle" value="1">

If you set a non-zero value, the state defaults to an On state: