HTML DOM removeAttribute () method
Examples
Remove style attribute head element:
document.getElementsByTagName("H1")[0].removeAttribute("style");
Delete Attribute ago:
Hello World
Remove property:
Hello World
try it"
Definition and Usage
removeAttribute () method Removes the specified attribute
View similar method removeAttributeNode () .
Browser Support
All major browsers support removeAttribute () method
grammar
element .removeAttribute (attributename)
Parameter s
参数 | 类型 | 描述 |
---|---|---|
attributename | String | 必需。规定要删除的属性的名称。 |
return value
No return value.
technical details
DOM version | Core Level 1 Element Object |
---|