I have a multiple select dropdown. I am trying to show the selected values in the dropdown.
If I hard code the values, it works -
$("select[name=clause1]").val(["ab","cd"]);
but if I define a variable with the values, it does not -
var temp = "[\"ab\",\"cd\"]";
$("select[name=clause1]").val(temp);
what I am doing wrong?