I have a JS Fiddle, my question is after first click things are working fine, but if again click on H3, the newclass is not getting toggled.
thanks for the help in advance
$('.recommendation-block > h3').addClass('newclass');
$('.recommended-product').addClass('hide');
$(document).ready(function () {
$('.recommendation-block > h3').click(function () {
$(this).next('.recommended-product').toggleClass('active');
if ($('.recommended-product').hasClass('active')) {
$(this).closest('.recommendation-block > h3').toggleClass('newclass1');
}
});
});