---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---

# hasAttribute

The `hasAttribute` method returns a `boolean` value indicating whether the specified attribute is present on the element.

## Syntax

```js
element.hasAttribute(attributeName);
```

### Parameters

- `attributeName` _: string_
  - The name of the attribute to check for.

### Return value

A boolean value indicating whether the attribute is present.

