Fall in IT.

HTML select 태그 사용시 기본값 설정방법 본문

프로그래밍언어/Html & Css

HTML select 태그 사용시 기본값 설정방법

D.Y 2019. 6. 3. 14:37

HTML의 select 태그 사용시 기본값을 설정하는 방법

예제

```
< select className="select-box" onChange={this.onChange.bind(this)}>
    < option value="" selected disabled hidden >선택해주세요.< /option>
    < option value="1" >아빠< /option>
    < option value="2" >엄마< /option>
< /select >
```


참조
https://stackoverflow.com/questions/3518002/how-can-i-set-the-default-value-for-an-html-select-element

 

How can I set the default value for an HTML

element below would cause thecontaining my provided "value" to be selected by default:

 

Comments