html - JavaScript undo onclick action? -


i have html checkbox. uses onclick javascript event increment integer var 1.

i want decrement var 1 if checkbox unchecked. how can this?

$('.checkbox').click (function(){   var thischeck = $(this);    if ( thischeck.is(':checked') ) {     // increment   }   else { // decrement } }); 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -