# Text not allowed in element “ol” in this context.

> Canonical HTML version: https://rocketvalidator.com/html-validation/text-not-allowed-in-element-ol-in-this-context
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

Text content cannot be placed directly inside an `ol` element. All text within an ordered list must be wrapped in `li` elements.

The `ol` element accepts only `li`, `script`, and `template` elements as children. Any bare text node placed directly between `<ol>` and `</ol>` (or between `</li>` and `<li>`) is invalid. This includes whitespace-only text nodes in some edge cases, but the validator typically flags visible text content.

This error often appears when list items are missing their `<li>` tags, or when extra text (like a heading or description) is placed inside the `ol` instead of before or after it.

## Invalid example

```html
<ol>
  Some introductory text
  <li>First item</li>
  <li>Second item</li>
</ol>
```

## Valid example

Move the text outside the `ol`, or wrap each piece of text in an `li` element:

```html
<p>Some introductory text</p>
<ol>
  <li>First item</li>
  <li>Second item</li>
</ol>
```
