Remove text after element
<p>I am trying to remove the text after the icon.</p>

<pre><code>&lt;i class="flagstrap-icon flagstrap-as" style="margin-right: 10px;"&gt;x&lt;/i&gt;France

$('.flagstrap-icon').next().remove();
</code></pre>

<p>The problem is that next() will not work without an element.</p>

<p>Example <code>&lt;span&gt;France&lt;/span&gt;</code></p>

<p><a href="https://jsfiddle.net/8bn8e0q2/" rel="nofollow noreferrer">Demo</a></p>

<p>Any idea to remove the text after the icon?</p>