JSFiddle - React, Tailwind, and code Playground

HTML

Discount:
<select class="select" name="discount" onchange="updateInput()">
    <option value="5" selected>5% discount</option>
    <option value="10">10% discount</option>
    <option value="20">20% discount</option>
</select>

Price:
<input type="text" name="price" value="">

JavaScript

function updateInput(){
    var discount = document.getElementsByName("discount")[0].value;
    var currentPrice = document.getElementsByName("price")[0].value;
    document.getElementsByName("price")[0].value =  currentPrice - ((discount/100) * currentPrice);
}