我正在使用 Jquery select2
,我有一个这样的选择框
<select multiple="multiple" id="address">
<optgroup class="op1" label="Maryland">
<optgroup class="op2" label="Perth">
<option value="West Baltimore Street, Baltimore, MD">West Baltimore Street, Baltimore, MD</option>
<option value="Massachusetts">Massachusetts</option>
<option value="Njurunda, Sweden">Njurunda, Sweden</option>
</optgroup>
</optgroup>
<optgroup class="op1" label="Kerala">
<optgroup class="op2" label="Ernakulam">
<option value="Ernakulam, Kerala, India">Ernakulam, Kerala, India</option>
<option value="Muvattupuzha, Kerala, India">Muvattupuzha, Kerala, India</option>
</optgroup>
<optgroup class="op2" label="Idukki">
<option value="Thodupuzha, Kerala, India">Thodupuzha, Kerala, India</option>
</optgroup>
</optgroup>
</select>
我得到的输出select2
我的实际输出应该是这样的
那<optgroup class="op1" label="kerala">
是缺失的。知道怎么做吗?