开发者

changing id of <td> in JQuery

How do you c开发者_JAVA技巧hange the id of a td element in JQuery?


You can use attr and an id selector:

var element = $('#currentId');
element.attr('id', 'newId');

You can also set it directly in pure JavaScript:

var td = document.getElementById('currentId');
td.id = 'newId';
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜