移除属性
removeAttribute
函数签名
typescript
function removeAttribute(element: Element, attributeName: string): void描述
移除属性
参数
| 参数名 | 类型 | 可选 | 默认值 | 描述 |
|---|---|---|---|---|
element | Element | 否 | - | - |
attributeName | string | 否 | - | - |
返回值
void
点击查看源码
js
/**
* 移除属性
* @param element - 目标元素
* @param attributeName - 属性名
*/
export function removeAttribute(element, attributeName) {
if (element) {
element.removeAttribute(attributeName);
}
}ts
/**
* 移除属性
* @param element - 目标元素
* @param attributeName - 属性名
*/
export function removeAttribute(element: Element, attributeName: string): void {
if (element) {
element.removeAttribute(attributeName);
}
}如有错误,请提交issue :::