<form>
    <label for="user-color" style="display: block;">색상 선택</label>
    <select id="user-color" required>
        <option value="" disabled selected>좋아하는 색상 선택</option>
        <option value="red">빨강</option>
        <option value="blue">파랑</option>
        <option value="yellow">노랑</option>
        <option value="green">초록</option>
    </select>
    <button type="submit">제출</button>
</form>
브라우저에서 실제 표시된 모습
<form>
    <label for="user-color">색상 선택</label>
    <select id="user-color">
        <option value="red">빨강</option>
        <option value="blue">파랑</option>
        <option value="yellow">노랑</option>
        <option value="green">초록</option>
    </select>
</form>
<label for="user-color">색상 선택</label>
<select id="user-color">
    <option value="red">빨강</option>
    <option value="blue" selected>파랑</option>
    <option value="yellow">노랑</option>
    <option value="green">초록</option>
</select>
브라우저에서 실제 표시된 모습
<label for="user-color">색상 선택</label>
<select id="user-color">
    <option value="red">빨강</option>
    <option value="blue" disabled>파랑</option>
    <option value="yellow">노랑</option>
    <option value="green">초록</option>
</select>
브라우저에서 실제 표시된 모습
<optgroup label="text">
<!-- text: 옵션 그룹의 이름을 지정합니다. -->
<form>
    <label for="fruits" style="display: block;">과일을 선택하세요.</label>
    <select id="fruits">
        <optgroup label="감귤류">
            <option value="orange">오렌지</option>
            <option value="lemon">레몬</option>
            <option value="lime">라임</option>
        </optgroup>
        <optgroup label="베리류">
            <option value="strawberry">딸기</option>
            <option value="blueberry">블루베리</option>
            <option value="raspberry">라즈베리</option>
        </optgroup>
        <optgroup label="열대과일">
            <option value="mango">망고</option>
            <option value="pineapple">파인애플</option>
            <option value="banana">바나나</option>
        </optgroup>
    </select>
    <button type="submit">제출</button>
</form>
브라우저에서 실제 표시된 모습
<form>
    <label for="user-color" style="display: block;">색상 선택</label>
    <select id="user-color" required>
        <option value="" disabled selected>--좋아하는 색상 선택--</option>
        <option value="red">빨강</option>
        <option value="blue">파랑</option>
        <option value="yellow">노랑</option>
        <option value="green">초록</option>
    </select>
    <button type="submit">제출</button>
</form>
브라우저에서 실제 표시된 모습
<label for="user-color">색상 선택</label>
<select id="user-color" autofocus>
    <option value="red">빨강</option>
    <option value="blue">파랑</option>
    <option value="yellow">노랑</option>
    <option value="green">초록</option>
</select>
<label for="user-color">색상 선택</label>
<select id="user-color" multiple>
    <option value="red">빨강</option>
    <option value="blue">파랑</option>
    <option value="yellow">노랑</option>
    <option value="green">초록</option>
</select>
브라우저에서 실제 표시된 모습
<label for="user-color">색상 선택</label>
<select id="user-color" size="3">
    <option value="red">빨강</option>
    <option value="blue">파랑</option>
    <option value="yellow">노랑</option>
    <option value="green">초록</option>
    <option value="violet">보라</option>
    <option value="orange">주황</option>
</select>
브라우저에서 실제 표시된 모습
<label for="user-color">색상 선택</label>
<select id="user-color" disabled>
    <option value="red">빨강</option>
    <option value="blue">파랑</option>
    <option value="yellow">노랑</option>
    <option value="green">초록</option>
</select>
브라우저에서 실제 표시된 모습
<form>
    <label for="user-color" style="display: block;">색상 선택</label>
    <select id="user-color" required>
        <option value="" disabled>좋아하는 색상 선택</option> <!-- 플레이스홀더 구현하기 -->
        <option value="red">빨강</option>
        <option value="blue" selected>파랑</option>
        <option value="yellow">노랑</option>
        <option value="green">초록</option>
    </select>
    <button type="submit">제출</button>
</form>
브라우저에서 실제 표시된 모습
<form>
    <label for="user-color" style="display: block;">색상 선택</label>
    <select id="user-color" required>
        <option value="" disabled selected>좋아하는 색상 선택</option> <!-- 플레이스홀더 구현하기 -->
        <option value="red">빨강</option>
        <option value="blue">파랑</option>
        <option value="yellow">노랑</option>
        <option value="green">초록</option>
    </select>
    <button type="submit">제출</button>
</form>
브라우저에서 실제 표시된 모습
<form>
    <select id="user-color" required>
        <option value="" disabled selected>좋아하는 색상 선택</option>
        <option value="red">빨강</option>
        <option value="blue">파랑</option>
        <option value="yellow">노랑</option>
        <option value="green">초록</option>
    </select>
    <button type="submit">제출</button>
</form>
브라우저에서 실제 표시된 모습

마지막 업데이트 정보: 2024-07-04