append html to end of body using javascript

<html>
<head>
<title>append html to end of body using javascript</title>
</head>
<body style="background:lightgray">
<p>Click the button to test:</p>
<button onclick="appendHTMLToBody('<p>hello</p>')">append paragraph</button>
<script>
function appendHTMLToBody(html){
 document.body.innerHTML+=html;
}
</script>
</body>
</html>

Comments

Popular posts from this blog

How to write data into a excel file using vbscript

Format date as yyyy-mm-dd using vbscript