So. I just bought Jon Ducket's simplistic book on JavaScript. Great read.
And I've been trying one of the first examplen, "Creating an Array." I'm pretty sure I did everything exactly as the book says, but it won't work. The element I'm trying to print within stays empty. Hear's my body:
<body>
<script type="text/javascript" src="Excersize1.js"></script>
<p id='colors'></p>
</body>
And hear's my JavaScript in that file.
var colors;
// array for colors
colors = ['white', 'black', 'custom'];
var el = document.getElementById('colors');
el.textContent = colors[0];
Any thoughts?