# Element does not carry attribute

Source: https://xmlvalid.com/errors/element-does-not-carry-attribute

> An attribute declared #REQUIRED in the DTD is missing.

Example message: `Element note does not carry attribute id`

## Why it happens

- The attribute was left out or misspelt.

## How to fix it

- Add the attribute. For an `ID` attribute the value must be a name (it may not start with a digit) and unique in the document.

## Example that fails

```xml
<note>
  <to>Ana</to>
  <body>Hi</body>
</note>
```

## Fixed

```xml
<note id="n1">
  <to>Ana</to>
  <body>Hi</body>
</note>
```
