I need a function that helps me count certain divs in my php. I will explain better, I have a product verifier, it works as follows, I enter the product codes in textarea, I put it to fetch it and it does a check in the database. The products it already has, it returns as disapproved, the ones that do not have it returns as approved.
<script type="text/javascript">
function buscarProdutosRepro(str) {
document.getElementById(\'listProdutosRepro\').innerHTML += \'<div>\' + str + \'</div>\';
}
function buscarProdutosApro(str) {
document.getElementById(\'listProdutosApro\').innerHTML += \'<div>\' + str + \'</div>\';
}
function FormatoInvalido(str) {
document.getElementById(\'FormatoInvalido\').innerHTML += \'<div>\' + str + \'</div>\';
}
</script>
This function, it is applied here
<center>
<p style="background: #54bd0e; padding: 6px 20px; width: 180px; font-size: 13px; border-radius: 15px; color: #F0F0F0;">Produtos Carregados ('.$conta.') </p>
</center>
<div class="panel panel-green">
</span>
<div class="alert alert-success"><small>✔ Produtos Aprovados</small></div>
<i class="fa fa-spinner fa-spin" style="font-size:24px"></i> Verificando...
<div class="panel-body">
<br/><div id="listProdutosApro"></div>
</div>
</div>
<div class="panel panel-danger">
<div class="panel-heading"><small>✘ Produtos Reprovados</small></div>
<div class="panel-body">
<br/><div id="listProdutosRepro"></div>
</div>
</div>
<div class="panel panel-orange">
<div class="panel-heading">Invalidas</div>
<div class="panel-body">
<br/><div id="FormatoInvalido"></div>
</div>
</div>
It will print on the screen the results, div below div.
<br/><div id="listProdutosApro">
<br/><div id="listProdutosApro">
<br/><div id="listProdutosApro">
Result: link
And I want to count these divs, as if they were lines, so:
✔ Approved Products (80)