HTML <input> checked 속성

정의와 사용법

checked 속성은 페이지 로드 시 input 요소를 예약 선택해야 합니다.

checked 속성은 부울 속성입니다。

이 속성이 설정되어 있다면, 페이지 로드 시 <input> 요소를 예약 선택(선택)해야 합니다.

checked 속성은 다음과 함께 사용할 수 있습니다。 <input type="checkbox"><input type="radio"> 함께 사용합니다。

checked 속성은 페이지 로드 후 JavaScript 코드를 통해 설정할 수도 있습니다。

예제

HTML 표单에 예약 선택된 체크박스가 있습니다:

<form action="/action_page.php">
  <input type="checkbox" name="vehicle1" value="Bike">
  <label for="vehicle1">나는 자전거를 가지고 있습니다</label><br>
  <input type="checkbox" name="vehicle2" value="Car">
  <label for="vehicle2">나는 차를 가지고 있습니다</label><br>
  <input type="checkbox" name="vehicle3" value="Boat" checked>
  <label for="vehicle3">나는 배를 가지고 있습니다</label><br><br>
  <input type="submit" value="제출">
</form>

직접 시도해보세요

문법

<input checked>

브라우저 지원

크롬 에지 파이어폭스 사파리 오페라
크롬 에지 파이어폭스 사파리 오페라
지원 지원 지원 지원 지원