<p id="printhere"></p> <script> var txt = 'This is the variable.'; document.getElementById('printhere').innerHTML = txt; </script>