Created
January 11, 2017 13:44
-
-
Save sealucky7/e9ac6e5de508e067d7c89c8d8691e395 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<span class="form-group"> | |
<span id="decrease">-</span> | |
<input id="htop" type="text" value="1"> | |
<span id="increase">+</span> | |
</span> | |
var elm = $('#htop'); | |
function spin( vl ) { | |
elm.val( parseInt( elm.val(), 10 ) + vl ); | |
} | |
$('#increase').click( function() { spin( 1 ); } ); | |
$('#decrease').click( function() { if (elm.val () > 0 ){spin( -1 ); } }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment