I am using this:
$(this).parent('label').parent('li').parent('ul').find('img').removeClass('selectedRadio');
Instead of using parent 3 times how can I condense it?
ID and Element selector are the fastest selectors in jQuery.
Use closest instead of chaining parents:
$(this).closest('ul').find('img').removeClass('selectedRadio');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With