what is mean by this.innerhtml code example
Example 1: .innerhtml
// .innerHTML method is used to change the html contents of a DOM object
document.getElementById("demo").innerHTML = "Paragraph changed!";
Example 2: innertext vs innerhtml
Inner text below. It inject string as it is into the element.
My name is <b class="name">Raj Yadav</b>.
Inner html below. It renders the string into the element and treat as part of html document.
My name is Raj Yadav.