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 Quote 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>'); Quote Link to comment https://forums.phpfreaks.com/topic/238933-simple-doubt-loop/#findComment-1227764 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.