WEB Archive

[HTML] 라디오 버튼 만들기

universedevelope 2024. 8. 19. 17:10
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Test020.html</title>
</head>
<body>

<div>
	<h1>라디오 버튼 만들기</h1>
	<gr>
</div>

<div>
	<form>
		<p>1. 당신의 성별은?</p>
		<label>
		<input type = "radio" name = "gender" value="female">여자
		</label>
		
		<input type = "radio" name = "gender" value="male" id = "m">
		<label for = "m">남자</label>
		
		
		<br><br>
		<p>2. 당신이 좋아하는 과목은??</p>
		<label><input type = "radio" name = "subject"value = "kor"> 국어 </label>
		<label><input type = "radio" name = "subject"value = "eng"> 영어 </label>
		<label><input type = "radio" name = "subject"value = "mat" checked = "checked"> 수학 </label>
		<label><input type = "radio" name = "subject"value = "soc"> 사회 </label>
		<label><input type = "radio" name = "subject"value = "sct"> 과학 </label>
	</form>
</div>
</body>
</html>

label 을 활용해서

input 태그의 속성 radio 를 이용해서

radio 버튼을 만들어본다.

 

마치 회원가입 시 이것저것 선택하는 느낌..

728x90