I am doing website for searching careers using a html form. I am only allowed to use HTML and JavaScript to do this task. I managed to complete most of it however I had problems comparing the salary of the jobs and the salary the user inputs.


I have stored jobs in arrays and they are accessed using the catLength and catList. I only want the application to display jobs that are higher than the minimum salary selected by the user.

function miniSalary()
{
var myForm=document.getElementById("jobForm")
var catList=myForm.cat;
var catLength = catList.length;
var minSalary = myForm.salary.selected;
var valSal = minSalary.value;
var maxiSalary = myForm.maxSalary.value;


if (catLength )
{
for ( i=0;i<catList.length;i++)
{
if (catList[i].checked)
{

for (var j=0;j<jobs.length;j++)
{

if (catList[i].value == jobs[j].category)

{

if (valSal <= jobs[j].minimumSalary)
{
console.log("Working")
console.log(jobs[j].ujob + " Minimum salarry: " + jobs[j].minimumSalary)
}

}


}
}
}



}
}