<html> <body> <script language="JavaScript"> function function1() { var myElement = document.createElement('<div style="width:300; height:200;"></div>'); document.all.myButton.insertAdjacentElement('afterEnd', myElement); } </script> <button id="myButton" onclick="function1();">Insert element</button> </body> </html>