开发者

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' })
    ),
    // ...
);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜