0
I’m trying to remove a class from a label dynamically created by handlebars,
But I can’t find the label with his id;
On the console if you pass the idLabel it returns the right id.
"9-hb_usuario-label"
But when I try to do
$('form#hb_form').find(idLabel)
To remove the class it does not.
$('form#hb_form').find('input').each(function () {
console.log(!$(this));
var idLabel = $(this).attr('name') + "-label";
if (idLabel != "undefined-label") {
if ($(this).valid()) {
$('form#hb_form').find(idLabel).removeClass('hide').addClass('hide');
}
else {
$('form#hb_form').find(idLabel.text()).removeClass('hide');
}
}
});