I am using the Chosen jQuery plugin. I have a standard single that looks like this:
<select data-placeholder="Choose a country..." id="country">
<option value="AF">Afghanistan</option>
<option value="AL">Albania</option>
<option value="DZ">Algeria</option>
</select>
With my favorites, I get something like this:
<ul class="chosen-results">
<li class="active-result" style="" data-option-array-index="0">Afghanistan</li>
<li class="active-result" style="" data-option-array-index="1">Albania</li>
<li class="active-result" style="" data-option-array-index="2">Algeria</li>
</ul>
Is there an easy way to store option values (AF, AL, DZ) in list items using Chosen, for example, a data value or such an attribute? I could not find it in the docs.
Thanks in advance.
source
share