---
title: "Discussion on \"innerText vs innerHTML\" | Hashnode"
description: "Discussion on \"innerText vs innerHTML\". What is innerText?\nThe innerText method is used to get the text within the text excluding the tag itself. It avoids the tags within it and only return the text values in the form of the string.\nFor example\n<div id=\"HelloAll\">Hello All\n            <sp..."
url: "https://hashnode.com/posts/innertext-vs-innerhtml/63aa8e9f9c70de78b8bb9e95"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [innerText vs innerHTML](https://prashanthandel.hashnode.dev/innertext-vs-innerhtml?utm_source=hashnode&utm_medium=feed)

What is innerText? The innerText method is used to get the text within the text excluding the tag itself. It avoids the tags within it and only return the text values in the form of the string. For example <div id="HelloAll">Hello All <sp...

Dec 27, 2022 · 2 min read · prashanthandel.hashnode.dev  
Read the article

-   [#innertext](https://hashnode.com/tag/innertext)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#html5](https://hashnode.com/tag/html5)
-   [#innerhtml](https://hashnode.com/tag/innerhtml)
-   [#difference](https://hashnode.com/tag/difference)

## Written by

[Prashant Handel](https://hashnode.com/@prashanthandel)

@prashanthandel · Indore, India

  
[View profile](https://hashnode.com/@prashanthandel)

Frontend Developer

I'm a self taught web developer and a learner as well. I am sharing my experiences and knowledge here with a hope to help those who are beginners as sharing helps to grow together.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
