Or you can tell javascript where to write it.
<script type="text/javascript">
var elem = document.getElementById('myDiv');
var msg= 'Hello<br />';
elem.innerHTML = msg;
</script>
You can combine this with other functions to have function write content after being evaluated.