Javascript examples for DOM HTML Element:Div
Handle Uncaught Type Error for creating an empty div
<html> <head> <title>Bug fix for stackoverflow</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/* w ww . j a v a 2s .co m*/ this.elem = document.createElement('div'); document.getElementById('body').appendChild(this.elem); } </script> </head> <body id="body"> </body> </html>