title: javascript/jquery oop learning
body: <p>I am very new to OOP. my understanding is that, it is like CSS class, we have classes then we could apply/use it. </p>
  
  <p>this is my code.</p>
  
  <pre><code>$(".mybutton").click(function(){
      $(this).siblings('.mybutton').removeClass('active').end().addClass('active');           
  });
  
  
  $('.mybutton, .second').click(function(event){
      $('#thisDiv').hide().filter(this.hash).show();
      event.preventDefault();
  });
  
  $('.second').on("click", function(){
  $(".mybutton").eq(1).siblings('.mybutton').removeClass('active').end().addClass('active');
      $("html, body").animate({
          scrollTop: $('#contact').offset().left - 20},
          800);
  });
  </code></pre>
  
  <p>how should I convert them to oop style?</p>
  
  <pre><code>var Doit = {
      init:function(){
          $(".mybutton").on("click", this.active);
      },
      active:function(){
      $(this)
        .siblings('.mybutton')
            .removeClass('active')
                .end().addClass('active');
      },
      filter:function {
  
  
      }
  
  
  };
  
  Doit.init();
  </code></pre>
  
  <p>if someone could give me a hint, if my code really needs to be changed to OOP ?</p>
  
  <p>Thanks</p>