irankhosravi
3 months ago

javascript d-block not working.

Posted 3 months ago by irankhosravi

We have many radio input.

<div class="form-group row d-none" id="referral_code">
    <label for="referral_code">Referral Code</label>
<div class="col-md-10">
    <input id="referral_code" type="text" class="form-control" name="referral_code">
</div>
</div>
<input class="form-check-input" type="radio" name="familiar" id="google" value="1">
<input class="form-check-input" type="radio" name="familiar" id="friends" value="2">
<input class="form-check-input" type="radio" name="familiar" id="advertising" value="3">
<input class="form-check-input" type="radio" name="familiar" id="marketer" value="4">>

And when I click on #marketer should show #referral_code.

$("#marketer").click(function() {
    $('#referral_code').toggleClass('d-block');
});

Please sign in or create an account to participate in this conversation.