Sie sind auf Seite 1von 1

Use an event handler and do the rest within that.

$('#percent,#input').on('change input', function() {


var val = Number($('#input').val()) || 0,
per = Number($('#percent').val()) || 0;
$('#total').val(val + val * per / 100)
})
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"><
/script>
value
<input type="text" name="gvalue" id="input" class="input" required/>Percentage
<select name="percent" id="percent" class="input">
<option value="Country" selected>Select Percentage</option>
<option value="5">5</option>
<option value="10">10</option>
<option value="15">15</option>
</select>
Final Value
<input type="text" name="flvalue" class="input" id="total" required/>

var gv = $('#gvalue').val();
var pr = $('#percent').val();
var fv = gv +((gv *pr) /100);
$('#fvalue').val(fv);

Das könnte Ihnen auch gefallen