开发者

changing id of <td> in JQuery

开发者 https://www.devze.com 2023-02-14 01:42 出处:网络
How do you c开发者_JAVA技巧hange the id of a td element in JQuery?You can use attr and an id selector:

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

精彩评论

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