JSFiddle - React, Tailwind, and code Playground
HTML
<div class="productinfo2">
<h2>test</h2>
<span class="price">69,9</span>
<input type="text" class="quantity">
<span class="price2">69,9</span>
<span class="total">Total:</span>
<div class="line2"></div>
</div>
JavaScript
$('.quantity').keyup(function () {
var parent = $(this).parent(),
price = parent.find('.price').html().replace(',', '.'),
quantity = parent.find('.quantity').val().replace(',','.'),
result = parseFloat(price) * parseFloat(quantity);
parent.find('.price2').html(result);
});