I have a simple js function that if mt range value is betwwen 0 and 499 i set var cost_by_employee_count_first = 3310000;
else 0
function value_name(value) {
var count = document.getElementById("myRange");
var range = parseInt(value);
if (range >= 0 && range <= 499) {
var cost_by_employee_count_first = 3310000;
}
else {
var cost_by_employee_count_first = 0;
}
}
how can i then pas this var to my jquery function
jQuery(function($) {
// Function that formats a raw price amount
function formatPrice(rawPrice) {
return rawPrice.toLocaleString("en-US", {
style: "currency",
currency: "USD"
});
}
$('form#roi').on('click', '.calculate-roi', function() {
const cost_by_industry = parseInt($("#cost_by_ind").val()),
cost_by_employee_count = parseInt($("#cost_by_employee_c").val()),
no_empoyees = parseInt($(".no_emp").val()),
month_invest = parseInt($("#month_inv").val()),
expected_a_grow = 0.05,
aas = 120000,
fpr = 0.75,
avr = 0.75,
I wish to set cost_by_employee_count = cost_by_employee_count_first