JSFiddle - React, Tailwind, and code Playground

by Amatewasu

HTML

<input id="quantite" value="1" /><br />
<input id="resultat" value="" />

JavaScript

var quantite = document.getElementById('quantite'),
    resultat = document.getElementById('resultat'),
    prix = 5.5; // Ici le prix à l'unité

quantite.onchange = function(){
    resultat.value = parseInt(quantite.value, 10) * prix;
};