Hello, I have this code and I would like to add only the "CREDIT" category to someone from a force to my friend here.
$(document).ready(function () {
var $entrada = 0,
$saida = 0,
$total = 0;
$.each($("td[name='entrada']"), function() {
$entrada += parseFloat($(this).text().replace(",", "."));
});
$.each($("td[name='saida']"), function() {
$saida += parseFloat($(this).text().replace(",", "."));
});
$total = $entrada - $saida;
$("#totalEntrada").append("R$ " + $entrada);
$("#totalSaida").append("R$ " + $saida)
$("#totalGeral").append("R$ " + $total);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><body><h2>ENTRADA</h2><tablewidth="198" border="1" id="table">
<tr>
<td width="39%">PRODUTO</td>
<td width="12%">VALOR</td>
<td width="12%">CATEGORIA</td>
</tr>
<tr>
<td>1</td>
<td name="entrada">100,00</td>
<td name="CRED">PROVEDOR</td>
</tr>
<tr>
<td>2</td>
<td name="entrada">10,00</td>
<td name="CREDITO">CREDITO</td>
</tr>
</table>
<h2>SAIDA</h2>
<table width="196" border="1">
<tr>
<td width="39%">DESCRICAO</td>
<td width="12%">VALOR</td>
</tr>
<tr>
<td>SAIDA</td>
<td name="saida">50,00</td>
</tr>
</table>
<h2>TOTAL</h2>
<table border="1">
<tr>
<td>TOTAL ENTRADA</td>
<td id="totalEntrada"></td>
</tr>
<tr>
<td>TOTAL SAIDA</td>
<td id="totalSaida"></td>
</tr>
<tr>
<td>TOTAL GERAL</td>
<td id="totalGeral"></td>
</tr>
<tr>
<td>CREDITO</td>
<td id="CREDITO"></td>
</tr>
</table>
</body>