What’s the DOM? #3

Browser console
innerHTML and InnerText
textContent

innerText

Browser window rendered text
h1 content altered by innerText
innerText rendered in the browser window

textContent

This method returns the actual text which is written in the code editor not rendered text displays in the browser window.

textContent returns the unrendered text

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ahmadullahnikzad

Ahmadullahnikzad

17 Followers

I am a web developer who writes web development content for you to make web development easier