gardan06 Posted January 30, 2008 Share Posted January 30, 2008 I have: <div id="name"></div> Given the names "Michael", "Lue" and "Rachel" for example, how can i loop these 3 inside the div given? Is it even possible? In case you guys are wondering, i need it to put names in a table wherein the column has a limited width and height. Needless to say, it should only occupy 1 line, thus this solution. Thanks. Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted January 30, 2008 Share Posted January 30, 2008 you mean like this: <div id="name"> <script language="javascript"> var people = new Array(); people[0] = "Michael"; people[1] = "Lue"; people[2] = "Rachel"; var max = people.length - 1; for (i=0;i<=max;i++) { document.write(""+people[i]+"<br/>"); } </script> </div> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.