title: Remove span using jQuery
body: <p>I have a dynamic loop that generates the output similar to the following snippet. I need to remove <code>&lt;span&gt;&lt;i&gt;</code> and <code>&lt;br&gt;</code> and just leave the text wrapped in link. I've tried the following:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$('#links a').each(function(){
      var this = $(this),
      span = this.find('span'),
      text = span.text();
  
      span.remove();
      this.append(text);
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div id="links"&gt;
    &lt;a href="/1"&gt;
      &lt;span class="inline"&gt;
        &lt;i class="fa fa-question"&gt;&lt;/i&gt;
        &lt;br&gt;Help
      &lt;/span&gt;
    &lt;/a&gt;
  
    &lt;a href="/2"&gt;
      &lt;span class="inline"&gt;
        &lt;i class="fa fa-gear"&gt;&lt;/i&gt;
        &lt;br&gt;Fix
      &lt;/span&gt;
    &lt;/a&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Not getting expected results. What am I missing?</p>