innerText vs innerHTML | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

innerText vs innerHTML

Can anyone explain me the difference between innerText and innerHTML in Javascript. and when we use them.

11th Jul 2020, 5:40 PM
Samir Singh
Samir Singh - avatar
1 Answer
+ 6
if you want not only text but also insert html into a element then you can do that with innerHTML.
11th Jul 2020, 5:59 PM
JaScript
JaScript - avatar