How can i set multiple values for multiple select. This is what i have tried so far in jquery. I looking for a jquery as well as pure js solution(just for my knowledge).
for(x in gList)
{
$('#GList').val(gList[x]);
}
This is selecting only one and not all.
EDIT: I found another solution in jquery . Hope this too helps others. In the loop use
$("#GList option[value=" + gList[x] +"]").attr("selected","selected") ;
Example: Set a single select, a multiple select, checkboxes and a radio button ..