Reputation: 57
With my limited knowledge (or lack thereof) of JS, I'm trying to figure out a way to add a class to the parent of a specific element.
If been using this Fiddle to try to get it to work, but to no avail: https://jsfiddle.net/s0pca3cs/
if ($('.form__ select select').hasClass('error')) {
$(this).parent().addClass('active');
};
Anyone want to pinpoint here I mess it up? Thanks
Upvotes: 0
Views: 35