when i click on 'customer-row' it should add class 'open-carrier-tiers' in 'carrier-tiers'. which is working. but when i click on 'carrier-tiers-close-btn' then it should remove the same class that added before from its parent parent element. which is not working. and i am using $(this) because this whole code repeating multiple time on page.
<tr class="customer-row">
<td class="carrier-tiers">
<div class="content-box">
<li class="carrier-tiers-close-btn">close</li>
<form action="" method="POST">
<input type="text" name="Customer Name">
<button type="submit">Submit</button>
</form>
</div>
</td>
</tr>
Jquery
$(".customer-row").click(function () {
$(this).find("td.carrier-tiers").addClass('open-carrier-tiers');
});
$(".carrier-tiers-close-btn").click(function () {
$(this).parent().parent().removeClass('open-carrier-tiers');
});