JSFiddle - React, Tailwind, and code Playground
HTML
<p>Cena</p>
<input type="text" id="cena" />
<p>Doprava</p>
<input type="text" id="doprava" disabled/>
<p>Celkova Cena</p>
<input type="text" id="celkova" disabled/>
JavaScript
document.getElementById("cena").addEventListener("input", function() {
if (parseInt(document.getElementById("cena").value) < 999) {
document.getElementById("doprava").value = "120";
} else {
document.getElementById("doprava").value = "60";
}
document.getElementById("celkova").value = parseInt(document.getElementById("doprava").value) +
parseInt(document.getElementById("cena").value);
});