JSFiddle - React, Tailwind, and code Playground

by RDA123

HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<form method="post" action="" id="form-product">
    <div class="col-md-4">
        <div class="form-check">
            <input class="form-check-input" type="radio" id="vat1" name="vat" value="on" checked>
            <label class="form-check-label">
                Calculate VAT 
            </label>
        </div>
        <div class="form-check">
            <input class="form-check-input" type="radio" id="vat2" name="vat" value="off">
            <label class="form-check-label">
                Do not calculate VAT
            </label>
        </div>
    </div> 
</form>

JavaScript

$('#form-product input').on('change', function() {
   alert($('input[name=vat]:checked', '#form-product').val()); 
});