title: JQuery .hide() won't hide button suddenly
body: <p>I have this a button which a user can click on which adds a comment box at the bottom of the page. My button html looks like this:</p>
  
  <pre><code>&lt;input type="button" name="inspection_2895_14045_comment" tabindex="-1" value="+" class="commentBtn" onclick="generateComment('Test', 14045,1, this )"&gt;
  </code></pre>
  
  <p>So as you can see it calls a method called <code>generateComment</code> which looks like this:</p>
  
  <pre><code>    function generateComment(name, id, isInspection, button){
  
          //get the current button and hide it
          var btn = $("a[name='" + button.name + "'");
          btn.hide();//doesn't work
  
          var generatedName = '';
  
          if(isInspection){
              generatedName = "comment_" + id;
          }
          else{
              generatedName = "section_" + id;
          }
  
          var comment = $('#comments');
          var genHtml = '&lt;div class="bigDataDiv"&gt;' +
                        '     &lt;label class="commentBoxLabels"&gt;' + name + '&lt;/label&gt;' +
                        '     &lt;a href="#" class="comment_close" onclick="removeComment(\'' + button.name + '\',this, event);"&gt;x&lt;/a&gt;' +
                        '     &lt;textarea rows="4" class="commentBox" name=' + generatedName + ' maxlength="200"&gt;&lt;/textarea&gt;'
                        '&lt;/div&gt;';
          comment.append(genHtml);
  
          $('html,body').animate({
              scrollTop: $(".bigDataDiv").offset().top},
              'slow');
      }
  </code></pre>
  
  <p>All this method does it hide the button, generate the comment div then scroll to the newly created div. This code worked no problem and used to hide the button but now for some reason it doesn't work and the button still shows up</p>