jQuery concatenate selector and text
<p>I want to create an element with some text after it to add to a container element.</p>

<p>Say I have:</p>

<pre><code>$('&lt;span/&gt;').addClass('glyphicon glyphicon-folder-close') + ' ' + item.name
</code></pre>

<p>and I want that to work; is there a way?</p>

<p>I know I can use <code>add()</code> like so:</p>

<pre><code>$('&lt;span/&gt;').addClass('glyphicon glyphicon-folder-close').add(
    $('&lt;span/&gt;').html(' ' + item.name)
)
</code></pre>

<p>But can I do it without the extra selector?</p>