<!DOCTYPE html>
<html>
<body>
<ul id="myList">
<li>Coffee</li>
<li>Tea</li>
</ul>
<p>Click the button get the HTML content of the ul element.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myList").innerHTML;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>