Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在javascript中设置select 2框的默认值_Javascript_Jquery - Fatal编程技术网

如何在javascript中设置select 2框的默认值

如何在javascript中设置select 2框的默认值,javascript,jquery,Javascript,Jquery,如何在JavaScript中设置select 2框的默认值。 我有一个API,更新的值来自该API,我需要更新选择框$'ID'。选择2val,stringValue 您正在设置的stringValue应在“选择选项”中可用。的可能重复项

如何在JavaScript中设置select 2框的默认值。
我有一个API,更新的值来自该API,我需要更新选择框

$'ID'。选择2val,stringValue

您正在设置的stringValue应在“选择选项”中可用。

的可能重复项