felito Posted June 10, 2011 Share Posted June 10, 2011 Hi What is the correct syntax for this code? for(var i = 0; i < 10; i++) { alert(i); document.write('<option value="weddingpage.htm">Weddings'+i'</option>'); } just to learn, the alternative in jquery? thanks Link to comment https://forums.phpfreaks.com/topic/238933-simple-doubt-loop/ Share on other sites More sharing options...
cyberRobot Posted June 10, 2011 Share Posted June 10, 2011 You need to add another concatenation character (+) after the i variable: document.write('<option value="weddingpage.htm">Weddings'+i+'</option>'); Link to comment https://forums.phpfreaks.com/topic/238933-simple-doubt-loop/#findComment-1227764 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.