To get values ββfrom elements, you need to use the $.val() method (suppose this is an input element).
var price = $(".element").val();
Thus, the price will be 5 when using the following HTML:
<input type="text" value="5" class="element" />
You can simplify your data collection logic using the ternary operator as well:
var fee = ($(".element").val() > 1) ? 250 : 0 ;
So, if the value of our input (having the "class" element) is more than 1, the board will be 250. Otherwise, the board will be the value of our input (with the identifier "price").
source share