Sorting arranges displayed records according to a selected field. Text fields are ordered alphabetically, while number fields are ordered numerically. section 13.4.3
A web page typically handles sorting in three steps:
- Offer a drop-down list containing the sortable fields. section 13.4.3
- Detect the user’s selection with JavaScript and sort the records by that field. section 13.4.3
- Redisplay the reordered records in the page’s article element. section 13.4.3
A drop-down list with the ID "Sort" and the values: "Sort by Department" and "Sort by Title".
Use a Sort drop-down with options such as “Sort by Department” and “Sort by Title.” section 13.4.3
Course catalog
A course catalog can let users sort records by Department or Title. JavaScript fetches the JSON data, orders it using the chosen field, and writes the results into the page. section 13.4.3 section 13.5

















