JSFiddle - React, Tailwind, and code Playground

HTML

<input type="number" id="val" value="1" class="input-text" >

JavaScript

var price = 30;
                      
$("#val").blur(function(){
   var get_val = $(this).val();
   alert("there are " + get_val + price + " in your cart");
 });