I have this:\[code\]<?php $i=0;?><?php foreach($x as $y): ?><input type="hidden" id="theid<?php echo $i;?>" value="http://stackoverflow.com/questions/15646885/<?php echo $someVariable;?>"/><?php $i = $i + 1; ?><?php endforeach; ?>\[/code\]I need to get the value of each "theid" like this: \[code\]<script type="text/javascript">function somefunction(element, optionTitle) {var num = document.getElementById('theid').value;...</script>\[/code\]How can i do that considering the fact that "theid" has the $i added?Thanks.