I am trying to add some javascript to my HTML document. In my example I would like to display the square of 2 in text with HTML. The result should be calculated using a js script. For example, consider this:
In my header:
<script type="text/javascript">
var square = 2*2
</script>
In my body:
<p>The square of 2 is <span id="square">.</span></p>
What do I have to add to make this work?