title: Adding and removing a class at the same time as updating a div
body: <p>I am very new to JavaScript. I am trying to update a div, which works fine before the add and remove class pieces are added. The problem is when I add the class I can't seem to get it to be removed when the when the next image is clicked. I have used a remove class option, but it doesn't seem to want to work.</p>
  
  <p>Any help is appreciated. Here is the code:</p>
  
  <pre><code>$('[class^="question"]').on('click', function(e) {
    e.preventDefault();
    var numb = this.className.replace('question', '');
    $('[id^="answer"]').hide();
    $('.question*').removeClass('question*selected');
    $('#answer' + numb).show();
    $('.question' + numb).addClass('question' + numb + 'selected');
  });
  </code></pre>
  
  <p><a href="http://jsfiddle.net/c4n2zvsv/" rel="nofollow">Here is a link</a> to the Fiddle I am Playing with.</p>
  
  <p>Thanks.</p>