[Solved] jquery checked checkbox on refresh and unique value query


You jQuery code is slightly wrong, this should do what you want:

if ($("input[name="business_group"]:checked").val() === "accommodation") {    
    // code here
} else if ($("input[name="business_group"]:checked").val() === "food_drink") {
    // code here
}

Infact it would be better to save this value into a variable:

var checkedValue = $("input[name="business_group"]:checked").val();
switch(checkedValue) {
    case "accommodation": // do stuff; break;
    case "food_drink": // do other stuff; break;
}

1

solved jquery checked checkbox on refresh and unique value query