Easy Tutorial
❮ Prop Style Columnwidth Met Win Createpopup ❯

HTML DOM getAttribute() Method

Element Object

Example

Get the target attribute value of a link:

Output result:


Definition and Usage

The getAttribute() method retrieves the value of an attribute by its name.

Tip: If you want to return an attribute node, use the getAttributeNode method.


Browser Support

All major browsers support the getAttribute() method.


Syntax

Parameters

Parameter Type Description
attributename String Required. The attribute value you want to retrieve.

Return Value

Type Description
String The specified attribute value.

Technical Details

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


Element Object

❮ Prop Style Columnwidth Met Win Createpopup ❯