라디오 버튼
learn.freecodecamp.org 에서 익힘
index.html
It is considered best practice to explicitly define the relationship between a checkbox
input
and its correspondinglabel
by setting thefor
attribute on thelabel
element to match theid
attribute of the associatedinput
element. - learn.freecodecamp.org
레이블 요소의 for 속성을 연관된 입력 요소의 id 속성과 일치하도록 설정하여 체크 상자 입력과 해당 레이블 간의 관계를 명시적으로 정의하는 것이 좋다
checked
속성을 추가해서 박스가 체크된 상태로 만들 수도 있다.
Codepen으로 결과 보기
References
HTML / label - 폼의 양식에 이름 붙이는 태그https://www.codingfactory.net/11008
Last updated