+ 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
᠌᠌Code X
᠌᠌Code X - avatar
+ 1
Thanks..
7th Apr 2018, 7:11 AM
Dev Dutt
Dev Dutt - avatar