Javascript getElementById from php foreach loop

Gixlusannuany

New Member
So I have a php foreach loop as follows,\[code\]$i = 1;foreach($rows as $record){ <div id='ytplayer".$i++."'> </div>");}\[/code\]and then I have javascript which uses the \[code\]getElementById\[/code\] and it needs to get the div everytime it is looped, which would essentially be an array, but how would I do that, I know what I have below wont work, but something like this, since I know this is pretty close to how you would get this to work in php\[code\]document.getElementById('ytplayer');\[/code\]
 
Top