Jquery selecionando a linha com tabela, como usar o seletor this?
Pessoal, estou com duvida simples que estou quebrando a cabeça e não consegui resolver. Tenho a seguinte tabela:
<!DOCTYPE html>
<html>
<head>
<title>Loja</title>
<meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<style>
table, th, td {
border: 1px solid black;
}
</style>
</head>
<body>
<table>
<thead>
<tr>
<th>Produto</th>
<th>Pequena</th>
<th>Media</th>
<th>Grande</th>
<th>Extra Grande</th>
<th></th>
<th>Desconto</th>
</tr>
</thead>
<tbody>
<tr>
<td>Camisa Masculina simples</td>
<td>10,00</td>
<td>20,00</td>
<td>30,00</td>
<td>40,00</td>
<td><button>Aplicar</button></td>
<td><input></td>
</tr>
<tr>
<td>Camisa Feminina simples</td>
<td>10,00</td>
<td>20,00</td>
<td>30,00</td>
<td>40,00</td>
<td><button>Aplicar</button></td>
<td><input></td>
</tr>
<tr>
<td>Camisa Masculina Polo</td>
<td>10,00</td>
<td>20,00</td>
<td>30,00</td>
<td>40,00</td>
<td><button>Aplicar</button></td>
<td><input></td>
</tr>
<tr>
<td>Camiseta Feminina Gola V</td>
<td>10,00</td>
<td>20,00</td>
<td>30,00</td>
<td>40,00</td>
<td><button>Aplicar</button></td>
<td><input></td>
</tr>
</tbody>
</table>
</body>
<script type="text/javascript">
</script>
</html>
Ao clicar no button, como posso fazer um script, usando o jquery com seletor $(this), para que o desconto percentual, seja aplicado em todo os preços da linha daquele botão?
Agradeço desde já.Discussão (5)
Carregando comentários...