JQuery multiselect – Set a value as selected in the multiselect dropdown

======================================
To Select
=====================================
i = 0, size = allergies.length; 
for(i; i < size; i++){ $("#allergies").multiselect("widget").find(":checkbox[value='"+allergies[i]+"']").attr("checked","checked"); 
$("#allergies option[value='" + allergies[i] + "']").attr("selected", 1); 
$("#allergies").multiselect("refresh"); }


======================================
To UnSelect
=====================================

$("#allergies").multiselect("uncheckAll");