A simple example of how to append text in a html page using javascript:
Table of contents
Append text to a div using javascript innerHTML
A basic html page that display "hello world !" using javascript:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Javascript</title>
</head>
<body>
<div id="target_div"></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
var div = document.getElementById('target_div');
div.innerHTML += 'hello world !';
</script>
</body>
</html>
returns