News for hackers. Stuff that matters.
Re:Vue.js is easier to learn than jQuery by nicolasMLV on Sunday October 30, 2016 @10:17AM (#12829898)
You could simplify this

  <script>
    var counter = 0;
    $(document).ready(function() {
      var $output = $('#output');  
      $('#increment').click(function() {
        counter++;
        $output.html(counter);
      });
      $output.html(counter);
    });
 </script>
with

  <script>
    var counter = 0;
    $(document).on('click', '#increment', function() {
        counter++;
        $('#output').html(counter);
    });
  </script>

There are no comments on this comment yet.