I want a drop-down form like this:
---parent1---
?son1
?son2
---parent2--
?son1
?son2
---parent3--
---parent4--
---parent5--
?son1
?son2
It can be seen that it is 2 layer effect.
Cannot be linked with 2 selects. This is what customers want.
How to write html. What should this data look like?
Can optgroup meet the needs?
<select> <optgroup label="---parent1---"> <option>?son1</option> <option>?son2</option> </optgroup> <optgroup label="---parent2---"> <option>?son1</option> <option>?son2</option> </optgroup></select>
Yes. Thank you. I haven't written a dropdown form like this before. Either one or linked. I really don’t know about optgroup.