Skip to content

Instantly share code, notes, and snippets.

View nick-kravchenko's full-sized avatar
🇺🇦

Nick nick-kravchenko

🇺🇦
View GitHub Profile
;(function($){
$(document).ready(function(){
$('<button type="button" class="dec">-</button>').prependTo( inputWrapper );
$('<button type="button" class="inc">+</button>').appendTo( inputWrapper );
$( inputWrapper ).on('click', 'button', function(){
if ( !$(this).parent().find('>input[type="number"]').val() ) {
var val = 0;
} else {
var val = parseInt($(this).parent().find('>input[type="number"]').val());
}