Home  >  Article  >  Web Front-end  >  How to delete the id attribute in tr in jquery

How to delete the id attribute in tr in jquery

WBOY
WBOYOriginal
2022-04-02 16:15:112174browse

在jquery中,可以利用removeAttr()方法删除tr元素的id属性,该方法的作用就是从被选元素中移除属性,将括号中的参数设置为“id”即可,语法为“需要删除id属性的tr元素对象.removeAttr("id");”。

How to delete the id attribute in tr in jquery

本教程操作环境:windows10系统、jquery3.2.1版本、Dell G3电脑。

jquery中tr怎么删除id属性

removeAttr() 方法从被选元素中移除属性。

语法

$(selector).removeAttr(attribute)

attribute 必需。规定从指定元素中移除的属性。

示例如下:







Month Savings
January $100
January $100
January $100

输出结果:

How to delete the id attribute in tr in jquery

相关视频教程推荐:jQuery视频教程

The above is the detailed content of How to delete the id attribute in tr in jquery. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn