I have a jquery function..
*function isCheckedById(id) {
var checked = $("input[@id=" + id + "]:checked").length;
if (checked == 0) {
return false;
}
else {
return true;
}
}*
And I want to use return the value of this function in my php code..
if ("checked") // checked
{
echo '<input type="checkbox" name="'.$brand_item->name.'" value="'.$brand_item->slug.'" checked><label for="'.$brand_item->term_id.'">'.$brand_item->slug.'</label>';
}
Help me, what parameter should I give to If statement so that I can use the value return by my jquery function. I am using these codes in wordpress, Please explain in details as I am completely new to these things.