# innerHTML

*noun*

say it: **“IN-er AYCH-TEE-EM-EL”** **/ˈɪnər ˌeɪtʃ tiː ɛm ˈɛl/**

An element's contents as an HTML string; setting it replaces them with new elements.

## What is **innerHTML** in JavaScript?

**innerHTML** — An element's contents as an HTML string. Setting it replaces everything inside with new elements built from that HTML. Never put text a user typed into it: use `textContent` for that.

```javascript
const list = document.getElementById("specials");
list.innerHTML = "<li>Chai</li><li>Chang</li>";
```

## In a sentence

- “I filled the specials list by setting its **innerHTML** to two li tags.”

Level: Apprentice · [More JavaScript terms at this level](https://www.ask-codey.com/glossary?category=javascript&level=2)

Updated: October 28, 2026

Source: https://www.ask-codey.com/glossary/innerhtml
