Javascript examples for DOM HTML Element:Div
Create <div> element and set its content, then add to body
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {/* w w w . j ava2s . com*/ var response = {results: 123, id: 456}; var div = document.createElement("div"); div.innerHTML = "id: " + response.id + " results: " + response.results; document.getElementsByTagName("body")[0].appendChild(div); }); </script> </head> <body> </body> </html>