Comments pretty much explain the stuff you can't see. randInt does exactly what you'd expect, adDescription generates a description of an ad based on the return of randInt, and rLink generates a link based on the same.
<script type="text/javascript">
rNumber = randInt(5); //generate a random integer from 1 to 5
rAd = adDescription(rNumber); //description of the random ad
rLink = adLink(rNumber); //URL of the random ad
document.write("<a href='" + rLink + "'>");
document.write("<img src='ad" + rNumber + ".jpg' alt='" + rAd "'/>");
document.write("</a>");
</script>
My problem lies in my document.write calls.
When all is said and done, it should write the following to my html code
<a href="url">
<img src="adn.jpg" alt="description"/>
</a>
Yes, this is for school, and I know exactly what I want to do, but for some reason it's not rendering, and in my head, this makes sense. What blatantly obvious mistake am I making that I just can't see?
Edit: Oh, and this script is being called in a predetermined part of pre-baked code that was given to me. The rest of my code worked properly prior to me inserting this code in the div element that I was instructed to. Additionally, I have called the scripts that contain the above functions in my document head.
Edit2: Yep, I feel dumb.