A jQuery plugin for incrementing and decrementing values
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


jQuery Increment/Decrement Plugin

This plugin allows you to easily increment and decrement values with jQuery.


We’ll use this HTML as a base for all the following examples:

    <script src='/javascripts/jquery.increment-decrement.js' type='text/javascript'></script>
    <div id="counter">0</div>

Incrementing values


Decrementing values


Getting current value


Custom increment/decrement step

You can increment or decrement by any value you desire:

// Increment counter by 10

Listening to increment/decrement events

$('#counter').bind('increment', function(event, counter, value) {
  console.log('Incremented ' + counter + ' ' +  value);
$('#counter').bind('decrement', function(event, counter, value) {
  console.log('Decremented ' + counter + ' ' + value);