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
Post a Comment