I have the following table:
<table>
<thead>
<tr>
<th> Lunes </th>
<th> Martes </th>
<th> Miercoles </th>
<th> Jueves </th>
<th> Viernes </th>
<th> Puntos Obtenidos </th>
</tr>
</thead>
<tbody>
<tr>
<?php for ($i=1; $i <= 5 ; $i++):?>
<td>
<select name="puntos" id="puntos" required>
<option value=""></option>
<option value='12'>Verde</option>
<option value='8'>Azul</option>
<option value='6'>Amarillo</option>
<option value='0'>Rojo</option>
<option value='-8'>Negro</option>
</select>
</td>
<?php endfor;?>
<td>
<!-- Aquí iría el código para calcular los puntos -->
</td>
</tr>
</tbody>
</table>
I need to show in the last column " Points Obtained " the sum of the points according to the option value selected in each cell.
I tried Jquery but it only stores the value of the first cell.
<script>
$("#puntos").change(function(){
var valor = $(this).val();
console.log(valor);
});
</script>