[Solved] A way to implement counter in JQuery [closed]


I just implement in my code it is useful for you to began Fiddle

<button id="add">add</button>
<button id="delete">delete</button>
<div id="question"> text</div>

jquery

var count = 0;

$("#add").on("click" , function() { 
    count = count + 1;
    $("#question").text(count);
});

$("#delete").on("click" , function() { 
    if(count > 0) {
      count = count - 1;
      $("#question").text(count);
    }
});

3

solved A way to implement counter in JQuery [closed]