<label>
- input 태그를 설명할 때 사용
- for 속성에 input 태그의 id 속성 입력
- ex) label 태그 클릭 시 input 태그에 포커스가 감
- ex) 라디오버튼/체크박스의 label 태그 클릭 시 해당 항목이 체크됨
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>label_for</title>
</head>
<body>
<form>
<label for="name">이름</label>
<input id="name" type="text"><br>
<label for="agree">동의</label>
<input id="agree" type="radio">
</form>
</body>
</html>
'Frontend > HTML' 카테고리의 다른 글
반응형 웹 (0) | 2021.12.06 |
---|---|
시맨틱 구조 구현 예제 (0) | 2021.12.06 |
GET / POST 전송 방식 (0) | 2021.12.04 |
<input> 태그 개념과 속성 (0) | 2021.12.04 |
<link> 태그의 개념과 속성 ( rel / href / type ) (0) | 2021.12.04 |