Home  >  Article  >  Web Front-end  >  html drop-down form_html/css_WEB-ITnose

html drop-down form_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:12:381151browse

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?


Reply to discussion (solution)

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.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn