The SELECT element includes an options array that is accessible from JavaScript. You can use a loop to iterate through this array and count how many choices the user has selected. For each one, the option’s selected property will be true. The countSelect() function in this code does just that and returns the number of selected items. You can use the result of this function to make sure that the user has made at least one selection.