Javascript examples for DOM:Element innerHTML
Change element content with innerHTML
<html> <head></head> <body> <h1 id="myid"> what can javascript Do?</h1> <p id="demo">Javascript can change html content.</p> <button type="button" onclick="myFunction()"> Click Me!</button> <script type="text/javascript"> function myFunction() {//from w w w . j a va2 s . c o m document.getElementById('demo').innerHTML = 'hello javascript'; } </script> </body> </html>