+ 2

InnerHTML

what is innerHTML and what it does? what's its purpose?

2nd Mar 2018, 6:06 PM
Adilet Kambarov
Adilet Kambarov - avatar
4 Answers
+ 19
The innerHTML property sets or returns the HTML content (inner HTML) of an element. Learn more: https://www.w3schools.com/jsref/prop_html_innerhtml.asp https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML
2nd Mar 2018, 6:11 PM
NezhnyjVampir
+ 8
https://www.sololearn.com/learn/JavaScript/2752/
2nd Mar 2018, 6:18 PM
Vukan
Vukan - avatar
+ 5
it sets the inner text of an element <p>hello</p> <script> document.querySelector("p").innerHTML="Hy"; see what happens here is the text in that p element which was once hello is now hy that is:<p>Hy</p>
2nd Mar 2018, 6:11 PM
᠌᠌Code X
᠌᠌Code X - avatar
+ 2
Equals the HTML between the target elements open and closing tags.
2nd Mar 2018, 6:20 PM
josh mizzi
josh mizzi - avatar