The select content needs to be grouped by chance. In the past, it was controlled by a program. Today, we found that the optgroup attribute in the select statement can be used as follows, if you are interested, you can refer to the occasional need to group the select content. In the past, program control was used. Today, we found that there is an optgroup attribute available in the select statement.
Tested for firefox, ie, and other browsers. Currently, the only drawback is that the title style after the group cannot be customized. For example, if you want to change the font attribute, you cannot use a normal body, but you can change the color and size. In ie, italics and bold words are used by default.
The Code is as follows:
Select brand A AC BMW A Aston Martin A Audi B buss B Porsche B Baojun BMW B B Beijing Automobile B. BAIC weiwang B Beiqi Manufacturing B Benz