Login | Register | FAQ
Anonymous

Codes wrong?

+ Post a reply

2 posts Page 1 of 1


Codes wrong?

by zjing129 » Sun May 13, 2012 1:06 am

It seems that the codes provided in Lesson 7 "for" loop DO NOT work. The following should work:
Code: Select all
<div id="wrapper"></div>
<script type="text/javascript">
var container = document.getElementById('wrapper');
var randomNumber = Math.random();
var numImages = Math.floor(randomNumber * 11);
alert(numImages);
for (var i=1; i <= numImages; i++)
{
var newImage = '<img src="loop.gif" alt="#" />' + i;
container.innerHTML += newImage;
}
</script>


Is there any good reference for HTML language? Thanks in advance.
User avatar

zjing129

  • Posts: 4
  • Joined: Thu May 10, 2012 1:00 am

Re: Codes wrong?

by XainPro » Sun May 13, 2012 9:39 am

thank you for pointing out the problem the admin should replace that old code with new one and for html reference you can goto following url
http://www.w3schools.com/tags/default.asp
User avatar

XainPro

  • Posts: 3727
  • Joined: Fri Feb 17, 2012 8:10 pm


+ Post a reply

Page 1 of 1