Javascript examples for DOM:Element innerHTML
Element innerHTML Property - Alert the HTML content of a <p> element with id="demo":
<!DOCTYPE html> <html> <body> <p id="demo">Click the button.</p> <button onclick="myFunction()">Test</button> <script> function myFunction() {//w w w.ja v a 2 s.c o m console.log(document.getElementById("demo").innerHTML); } </script> </body> </html>