I need to know the amount of divs that contain a specific class, I thought of looking for all the css I have in the divs, so I'll eliminate it until I find the divs with "has-error", but I can not find who exactly has it a class "has-error"
How to do it?
$(document).on('click', "#btnSalvar", function () {
var erros = 0;
$("div").find('*').each(function () {
var classe = $(this).attr("class");
if (classe !== undefined) {
if ($("" + classe + ":contains(has-error)")) {
}
}
});
});
What I've done so far.
Edit:
How do I fix it for two people at the same time? hhaha Thanks everyone