1// .innerHTML method is used to change the html contents of a DOM object
2document.getElementById("demo").innerHTML = "Paragraph changed!";
1<p id="demo" class="demo_class"></p>
2
3<script>
4//simple
5document.getElementById("demo").innerHTML = "hello World";
6
7//advance
8document.getElementById("demo").innerHTML = person("ahsan", "21");
9
10function person(name1, age1) {
11 return ("Your name is " + name1 + ". You're " + age1 + " years old.");
12}
13
14</script>