Hello,

Ive recently set out to learn Javascript and all around i'm enjoying myself. I have a fairly good understanding of HTML and im looking to add JavaScript to the knowledgebase. I find my best means of learning is by trying to create pages, mostly at random and work with the various Javascript commands. However, this one is tripping me up. Accourding to the tutorials i've been reading it would seem this chunk of code should work... However it does not work as intended. Optimally there will be a function to give me the variable for streama but for the sake of troubleshooting i simplified it. Here is the output im getting....

Watch live video from No Stream on www.twitch.tv
theerebus

The intended output is obviously

Watch live video from the erebus on www.twitch.tv
theerebus


Code:
<html>
<body>

<script>
var streama = "theerebus";
document.getElementById("stream1").href="http://www.twitch.tv/";
document.getElementById("s").innerHTML="Watch live video from " + streama + " on www.twitch.tv";
</script>

<a href="http://www.twitch.tv/Nostream" class="trk" id="s" style="padding:2px 0px 4px; display:block; width:345px; font-weight:normal; font-size:10px; text-decoration:underline; text-align:center;">Watch live video from No Stream on www.twitch.tv</a>

<script>
document.write(streama);
</script>

</body>
</html>