Page 1 (index.php)
<?php for($i=0;$i<2;$i++) { ?>
<select id="name[<?php echo $i;?>]">
<option value="John">John</option>
<option value="Alice">Alice</option>
</select>
<input type="text" id="name-id">
<input type="text" id="location">
<?php } ?>
</table>
<script src="http://code.jquery.com/jquery-1.8.0.min.js"></script>
<script src="js/function.js"></script>
Page 2 (function.js)
for (i=0;i<2;i++){
$('select#name['+i+']').on('change',function()
{ alert(1); } ); }
The Code is not working after i add in the array.. Someone please help me..
<input name="some_name[]" >