<?php foreach ($fruits as $fruit) { ?>
<select name="fruits[]">
<option value="">Apple</option>
<option value="">Banana</option>
<option value="">Orange</option>
</select>
<input type="text" name="quantity" value="" />
<?php } ?>
<script>
$("select[input='fruits[]']").change(function () {
// how to get the fruits array index
// how to get the fruits array value
});
</script>
如何知道水果数组选择框中选择的具体索引和值?
提前致谢!