javascript - Selecting selectbox options by array values -


i getting values via json type ajax request jquery. when use alert(msg.options) alerts ["1","3","8"]

if use below script select needed options, works. selects options have value 1 , 3 , 8 :

$('#input_6').val(["1","3","8"]); 

but below script doesn't work if alerts same:

$('#input_6').val(msg.options); 

how can fix this? thank you...

try:

$('#input_6').val($.parsejson(msg.options)); 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -