title: Change anchor text and icon with jquery
body: <p>I have an anchor tag which hides or shows a div but I've been unable to change it's text and icon.</p>
  
  <p>How do I change the text AND icon tag, as currently it parses the icon tag out as regular text.</p>
  
  <p>Anchor tag:</p>
  
  <pre><code>&lt;a class="collapse-info btn"&gt;&lt;i class="icon-arrow-up icon-white"&gt;&lt;/i&gt; Hide Info&lt;/a&gt;
  </code></pre>
  
  <p>I need the class to go from "icon-arrow-up icon-white" to "icon-arrow-down icon-white" and back during toggles.</p>
  
  <p>Javascript (jquery)</p>
  
  <pre><code>$('.collapse-info').toggle(function() {
  $('.server-info').slideUp();
  $(this).text('Show Info');
  }, function () {
  $('.server-info').slideDown();
  $(this).text('Hide Info');
  });
  </code></pre>
  
  <p>Was trying something like $("#collapse-icon").toggleClass('icon-arrow-down'); but that won't work since the anchor text is overwritten after the initial toggle. </p>
  
  <p>Thanks for any help.</p>