I have selectors who have a name:
<select name="selector[]" id="selector">
<option value="1">Valor 1</option>
<option value="2">Valor 2</option>
</select>
<select name="selector[]" id="selector">
<option value="1">Valor 1</option>
<option value="2">Valor 2</option>
</select>
These selectors can be 1, 10 or 20 depending on the circumstances, and I would like to know which selector is clicked by the user with Jquery, the selector [1], selector [2] , etc.
When it's only 1 selector, I can perform actions on the con jquery easily like this:
$('#selector').on('change', function(e){
e.preventDefault();
// acciones
});
But when the selector is not the first one, this does not work anymore, so I need to know which selector clicked on.
Greetings and Thanks!