Can somebody please explain me what is the function of ".innerHTML" in JavaScript?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can somebody please explain me what is the function of ".innerHTML" in JavaScript??

I want to know what it does and how it works. Please help me out.

7th Apr 2018, 6:48 AM
Dev Dutt
Dev Dutt - avatar
2 Answers
+ 2
it's property used in changing the innerTexts of Dom elements <div>hello</div> div=document.querySelector("div"); //getting the div element div.innerHTML="love" then html should look like <div>love</div>
7th Apr 2018, 6:49 AM
᠌᠌Brains[Abidemi]
᠌᠌Brains[Abidemi] - avatar
+ 1
Thanks..
7th Apr 2018, 7:11 AM
Dev Dutt
Dev Dutt - avatar