Javascript examples for DOM:Element innerHTML
<!DOCTYPE html> <html> <body> <ul id="myList"> <li>A</li> <li>B</li> </ul>/* w w w . j a v a 2 s . c o m*/ <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("myList").innerHTML; document.getElementById("demo").innerHTML = x; } </script> </body> </html>