The following examples cover some of the basics when working with a <select> HTML element.
Fill multiple selects with JSON data onchange
This example fills a second (or more) <select> HTML element with data from a JSON request. Useful in those situations where the selection of the previous <select> element determines what needs to go in the next <select> such as car manufacturers, makes, year, models, etc.
Fill multiple selects with JSON data onchange and set the default for secondary <select> on post
This exmaple is similar to the above but by default the second <select> will lose it’s selected value after a POST. This example will remedy that problem.
Set the default selected value for a <select> HTML element onload
This example will show how to set the default selected value on page load.
Download
Download source code for all examples above






















I can tell that this is not the first time you write about the topic. Why have you decided to write about it again?