I am trying to calculate the CGST/SGST/IGST based on input#input.
here I am considering input#gst_rate = 18.
actually, I am trying - if the user selects LOCAL then input#gst_rate will be divided into 2 and the value as 9 will show in input#cgst = 9 and input#sgst = 9 and input#igst = 0.
If the user selects INTERSTAE then input#gst_rate will show in input#igst = 18 and input#cgst = 0 and input#sgst = 0.
I am not familiar with javascript and jQuery. Please help me with how I achieve the code.
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<select name="gst_type" class="gst_type" id="gst_type">
<option value="1">LOCAL</option>
<option value="2">INTERSTATE</option>
</select>
<input type="text" class="form-control gst_rate" id="gst_rate" value="18">
<br/><br/>
<input type="text" class="form-control cgst" id="cgst" placeholder="CGST">
<input type="text" class="form-control sgst" id="sgst" placeholder="SGST">
<input type="text" class="form-control igst" id="igst" placeholder="IGST">