create <image> in <td>
I want to add an <img>
in a <td>
$myRow = $("<tr></tr>");
$开发者_JAVA技巧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' })
),
// ...
);
精彩评论