I want to add an <img> in a <td>
$myRow = $("<tr></tr>");
$myRow.append("<td>$('<img/>').attr({ src: 'xx' })</td>"),
as expected it's considering it as a string.
How to format this using jQuery, so that it creates an <img>?
I want to add an <img> in a <td>
$myRow = $("<tr></tr>");
$myRow.append("<td>$('<img/>').attr({ src: 'xx' })</td>"),
as expected it's considering it as a string.
How to format this using jQuery, so that it creates an <img>?
$myRow = $("<tr></tr>");
$('<td></td>').appendTo($myRow)
.append($('<img/>')
.attr({ src: 'xx' })
),
// ...
);