One issue I am facing is related to two tables with radio buttons. Each table highlights the corresponding row when a radio button is checked, working independently. However, I need a specific value from table 1 to un-highlight any previously checked rows in table 2. Either ID "1E" or the value "Fixed Income" from table 1 should remove the highlight from table 2.
$('input[name="radio1"]').click(function() {
$(".checked").removeClass("checked");
if($(this).is(':checked')) {
$(this).closest('.highOption').addClass('checked');
}
});
$('input[name="radio2"]').click(function() {
$(".checked2").removeClass("checked2");
if($(this).is(':checked')) {
$(this).closest('.highOption').addClass('checked2');
}
});
// Various attempts were made to achieve this, but without success.
$('input[value="Fixed Income"]').click(function() {
$(".checked").removeClass("checked");
$(".checked2").removeClass("checked2");
});
.checked {
background-color:rgba(242,242,242,0.5)
}
.checked2 {
background-color:rgba(242,242,242,0.5)
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table>
...
</table>
<br><br>
<table>
...
</table>