Easy Tutorial
❮ Prop Document Doctype Dom Obj Form ❯

HTML DOM removeAttribute() Method

Element Object

Example

Remove the style attribute from the head element:

Before removing the attribute:

Hello World

After removing the attribute:

Hello World

Definition and Usage

The removeAttribute() method removes the specified attribute.

See similar method removeAttributeNode().


Browser Support

All major browsers support the removeAttribute() method.


Syntax

Parameters

Parameter Type Description
attributename String Required. Specifies the name of the attribute to remove.

Return Value

No return value.

Technical Details

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


Element Object

❮ Prop Document Doctype Dom Obj Form ❯