Easy Tutorial
❮ Met Element Matches Prop Table Caption ❯

HTML DOM removeAttributeNode() Method

Element Object

Example

Remove the attribute node from the head element:

Before removing the attribute:

Hello World

After removing the attribute:

Hello World

Definition and Usage

The removeAttributeNode() method removes the specified attribute node from an element.

This method removes (and returns) an Attr node from the current element's attribute collection. If the DTD sets a default value for the removed attribute, a new Attr node representing this default value will be added. Using the removeAttribute() method is often simpler.

Refer to the removeAttribute() method.


Browser Support

All major browsers support the removeAttributeNode() method except Internet Explorer.


Syntax

Parameters

Parameter Type Description
attributenode Attr object Required. The attribute node you want to remove.

Return Value

Type Description
Attr object The removed attribute node.

Technical Details

| DOM Version | Core Level 1 Element Object | | --- | --- |


Element Object

❮ Met Element Matches Prop Table Caption ❯