 <p>This approach have better performance, cause you are setting the find to a var and doing a loop instead of doind a loop with the find.</p> <pre><code>var child = $('#room_remove'+id).find('li'); if(child.length &gt; 0){ var li = ""; child.each(function(){ li += "&lt;li&gt;"+$(this).text()+"&lt;/li&gt;"; }); } $(".mauDIDROP").append($(li)); </code></pre>