New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bootstrip-button

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bootstrip-button

button plugin for bootstrip

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

bootstrip-button

browser support

Twitter bootstrap button without jQuery

All credit goes to the devs of bootstrap as this is heavily based on the button plugin from it

Install

$ npm install --save bootstrip-button

Tests

$ npm test

Example

var Button = require('bootstrip-button')
var $ = require('dom')
var ele = $('.btn-biscuits')
var button = new Button(ele, {
  loadingText: 'submitting...'
})

ele.on('click', function(e) {
  // set state to loading
  button.loading()
  setTimeout(function() {
    // reset state
    button.reset()
  }, 600)
})

API

Button(ele, opts)

  • ele The selector for the ele
  • opts (optional)
    • object: { loadingText: 'loading...' }
    • string: loading...

Button.prototype.toggle()

Toggles the button between loading and reset states

Button.prototype.loading()

Sets the button state to loading if it is not already that

Button.prototype.reset()

Sets the button state to reset if it is not already that

Button.prototype.val()

Gets the correct value for the button element. If it is an input, it returns the value attribute, otherwise, it returns the elements innerHTML

License MIT

Licensed under the MIT license. For more info, see LICENSE

Keywords

FAQs

Package last updated on 04 Jul 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc