JSFiddle - React, Tailwind, and code Playground

HTML

<input class="num" type="text" name="width" />
<input class="num" type="text" name="length" />
<input type="hidden" class="num" name="price" value="0.20" />
<input type="text" class="tot" name="total" />

JavaScript

$('.num').change(function(){
    var tot = 1;
    $.each($('.num'),function(){
      var curr_val = $(this).val();
        if(curr_val != ""){
          tot = tot * curr_val;
          parseInt($('.tot').val(tot.toFixed(2))) + 0.30*1 * 0.029*1;
        }           
    });

});