Javascript examples for DOM HTML Element:Body
Create and append text in the body using JavaScript
<html> <head> <title>Number guessing game</title> </head> <body> <script type="text/javascript"> var par = document.createElement("p"); var text = document.createTextNode("fhsgdjrs hgrtsfya"); par.appendChild(text);/*from w ww .j av a2 s. c o m*/ document.getElementsByTagName('body')[0].appendChild(par); </script> </body> </html>