How to display an HTML image
2 answers
Say you have an element like this:
<code id="mycode"></code>
You can do it as follows:
$("#mycode").append($("<div />").append($('img').clone()).html());
Or, if you want it to be semi-encoded for display, for example:
var html = $("<div />").append($('img').clone()).html();
$("#mycode").append(html.replace('<','<').replace('>','>'));
+5