If you have a select with option groups:
<select data-nested-select="Select country">
<option>Select city</option>
<optgroup label="Bulgaria">
<option value="sofia">Sofia</option>
<option value="plovdiv">Plovdiv</option>
</optgroup>
<optgroup label="Sweden">
<option value="stockholm">Stockholm</option>
<option value="uppsala">Uppsala</option>
</optgroup>
</select>
This jQuery snippet will convert it to two separate 's -- one for country and one for city. Whenever the user changes the country, the other will display only the cities that are in that country.
This comment has been minimized.
alex-jitbit commentedNov 9, 2018
thanks