I have a table with the Price field that is extracted from mysqli by php, and another field Quantity that is a select (values from 0 to 10) that I extract with jquery, occupy jquery to detect the change of value of the select. How do I show the result of the multiplication of both values in a div answer? Sure, without reloading the page.
<script>
$(document).ready(function(){
$("select[name=ant01]").change(function(){
alert($('select[name=ant01]').val());
});
});
</script>
<table class="table">
<thead>
<tr>
<th>Nombre/Descripción</th>
<th>Cant</th>
<th>Precio</th>
</tr>
</thead>
<tbody>
<tr>
<td><b>Antojitos</b></td>
<td>
<div class="form-group">
<label for="sel1">Cant:</label>
<select class="form-control" name="ant01">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
</div>
</td>
<td id="ant01_precio">
<?php echo $variable_php_precio; ?>
<div id="respuesta"></div>
</td>
</tr>
</tbody>
</table>
Greetings and thanks