 <p>Why are you doing that, just append an image.</p> <pre><code>$("#target").append("&lt;img src='img.jpg' /&gt;"); </code></pre> <p>other way</p> <pre><code>$('&lt;img/&gt;', { src: 'img.jpg' }).appendTo("#target"); </code></pre>