Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<p>Click the button to create an OL element and a LI element.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
  var x = document.createElement("OL");
  x.setAttribute("id", "myOl");
  document.body.appendChild(x);
  var y = document.createElement("LI");
  var t = document.createTextNode("Coffee");
  y.appendChild(t);
  document.getElementById("myOl").appendChild(y);
}
</script>
</body>
</html>