Javascript examples for DOM HTML Element:Div
Set property 'innerHTML' of div
<!doctype html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Example</title> </head> <body> <div id="hello"></div> <script type="text/javascript"> what();// www . j av a 2s .co m function what(){ document.getElementById('hello').innerHTML = '<p>hi</p>'; }; </script> </body> </html>