Tag Archives: Sort Select

Sort Select list items using jQuery

In this Article, you find out jQuery code to sort dropdown list items. The items can be sorted by item’s text and also by item’s value in ascending or descending order. First create dropdown list items in html <select id="ddlList"> <option value="3">Three</option> <option value="1">One</option> <option value="0">Zero</option> <option value="2">Two</option> <option value="8">Eight</option> </select> <br/><br/> <input type="button" id="btnSort" Value="Sort Dropdown By Text" /> <input type="button" id="btnSortVal" Value="Sort Dropdown By Value" /> With above html code we create dropdown list. to give it style […]