When button checked change background color of containing div.
<script>
$('.radio-btn').click(function() {
if( $(this).is(':checked')) {
$document.getElementsByClassName("row").addClass("hvr");
}
});
</script>
.hvr {
background-color: #f2f2f2;
}
<div class="row"><input type="radio" class="radio-btn" name="payment-options" /></div>
When I click on the radio button I want the background color of the containing div to change. What I have here isn't working. Can anybody help?