JavaScript innerHTML

Johnny Simpson
JavaScript in Plain English
3 min readFeb 6, 2023

--

In Javascript, we have lots of different ways to manipulate DOM elements. DOM elements are the HTML elements we define when we write our scripts. Once we are targetting a particular DOM element, it’s often useful to set its contents with new HTML content, or to retrieve its HTML content for use somewhere else.

To do this, we use innerHTML. All Javascript DOM-type elements have an innerHTML property attached. Selecting HTML

--

--