https://github.com/saulsluz/jquery-prevent
Simple toggle element to change the normal state of a element to a push state and vice versa
https://github.com/saulsluz/jquery-prevent
jquery-plugin toggle-buttons
Last synced: 4 months ago
JSON representation
Simple toggle element to change the normal state of a element to a push state and vice versa
- Host: GitHub
- URL: https://github.com/saulsluz/jquery-prevent
- Owner: saulsluz
- License: mit
- Created: 2018-03-20T03:27:57.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-20T03:44:14.000Z (about 8 years ago)
- Last Synced: 2025-10-23T04:31:48.342Z (8 months ago)
- Topics: jquery-plugin, toggle-buttons
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jquery-prevent
Simple toggle element to change the normal state of a button to a push state and vice versa
## Usage
To change to a push state
```javascript
$('#element').prevent('store').prevent('block')
```
To change to a push normal
```javascript
$('#element').prevent('restore')
```
To change to a push normal and set an attribute
```javascript
$('#element').prevent('restore', e => e.val(someValue))
```
## Test