title: How use jquery to change text of input button on click?
body: <p>I want to change the ADD text of the following button into "REMOVE" when clicking the button.</p>
  
  <pre><code>&lt;input class="btn btn-6d" ahref="www.test.com" type="button" value="ADD"/&gt;
  </code></pre>
  
  <p>I used the following jquery code for this:</p>
  
  <pre><code>$(':input[type="button"][class="btn-6d"]').click(function(){
  var $this = $(this);
  $this.toggleClass('btn-6d');
  if($this.hasClass('btn-6d')){
      $this.value('ADD');         
  } else {
      $this.value('REMOVE');
  }
  });
  </code></pre>
  
  <p>I'm probably doing something wrong with my selectors but I'm relatively new to programming and can't figure out what I'm doing wrong. </p>
  
  <p>Here is a fiddle for you to play with: </p>
  
  <p><a href="http://jsfiddle.net/stijn777/shzuwu0v/" rel="nofollow">http://jsfiddle.net/stijn777/shzuwu0v/</a></p>
  
  <p>Thanks in advance, </p>
  
  <p>Stijn</p>