I have a simple task I'm trying to accomplish learning JavaScript but haven't been able to find a clear answer. Here's the code;
<script type="text/javascript">
var show = document.getElementById("box");
document.write(show);
</script>
<div id="box">Testing</div>
Basically I want the text in the box div to be stored into a variable. Then, I want to display that variable's text on a different part of the page. With the code above I get a null error.
Thanks.