JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="quantity" onkeyup="updateTotal();"/>
<span id="totalPrice"></span>
JavaScript
var unitPrice = 50;
function updateTotal() {
var quantity = parseInt(document.getElementById('quantity').value, 10);
if(isNaN(quantity)) quantity = 0;
var totalPrice = unitPrice * quantity;
document.getElementById('totalPrice').innerText = totalPrice;
}