Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

counter pluse and minus one javscript

function count(clicked_id)
  {
  var counter = document.getElementById('counter').innerHTML;
    var parsed = parseInt(counter);
      let result = clicked_id == "minus" ? parsed - 1 : parsed + 1;
      document.getElementById('counter').innerHTML = result;
  }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #counter #pluse #javscript
ADD COMMENT
Topic
Name
3+9 =