์›น ํ”„๋กœ๊ทธ๋ž˜๋ฐ - form์˜ ์‘์šฉ

2020. 9. 17. 00:32ใ†์ „๊ณต ๊ณผ๋ชฉ/์›น ํ”„๋กœ๊ทธ๋ž˜๋ฐ

์›น ํ”„๋กœ๊ทธ๋ž˜๋ฐ - form์˜ ์‘์šฉ

 

์˜ค๋Š˜์€ form์š”์†Œ ์ค‘์—์„œ fieldset, legend๋ฅผ ์ด์šฉํ•ด์„œ ๋” ๊ตฌ์กฐ์ ์ธ ํผ์„ ๋งŒ๋“ค์–ด ๋ณผ ๊ฒƒ์ด๋‹ค.

fieldset์€ ํฐ ํ‹€, legend๋Š” ํ‹€์˜ ์ œ๋ชฉ์ด๋ผ๊ณ  ๋ณด๋ฉด ๋œ๋‹ค.

 

์•„๋ž˜ ํ™”๋ฉด์„ ํ•œ๋ฒˆ ๋งŒ๋“ค์–ด๋ณด๋„๋ก ํ•˜์ž.

 

์†Œ์Šค ์ฝ”๋“œ

<!DOCTYPE html>
<html>
<head>

</head>
<body>
<h2>ํผ ์—ฐ๊ฒฐํ•˜๊ธฐ</h2>
<form name = "form1" method ="get" action = "">
<fieldset>
<legend>๋กœ๊ทธ์ธ ์ •๋ณด</legend>
์•„์ด๋””:<input type = "text" name = "id"><br>
๋น„๋ฐ€๋ฒˆํ˜ธ:<input type = "password" name = "pwd" maxlength = "5"><br>
์ด๋ฉ”์ผ:<input type = "text" name = "email" ><br>
	</fieldset>
	<fieldset>
    <legend>๊ฐœ์ธ์ •๋ณด</legend>
    ์ด๋ฆ„:<input type = "text" name= "irum"><br>
    ์ƒ๋…„์›”์ผ:<input type = "text" name ="birth"><br>
	</fieldset>
	<fieldset>
    <legend>์‹ ์ƒ์ •๋ณด</legend>
    ์„ฑ๋ณ„ <input type ="radio" name = "woman">์—ฌ์„ฑ <input type = "radio" name = "man">๋‚จ์„ฑ<br>
    ์ทจ๋ฏธ<input type = "checkbox" name = "read">๋…์„œ<input type = "checkbox" name = "swim">์ˆ˜์˜<input type = "checkbox" name = "movie">์˜ํ™”๊ฐ์ƒ<input type = "checkbox" name ="travle">์—ฌํ–‰
	</fieldset>
	<fieldset>
    <legend>์†Œ์†</legend>
    <select name = "subject" size =5>
    	<option>๊ฒŒ์ž„ํ•™๊ณผ</option>
    	<option>์ปดํ“จํ„ฐ๊ณตํ•™๊ณผ</option>
    	<option>์ •๋ณดํ†ต์‹ ํ•™๊ณผ</option>
    	<option>์œตํ•ฉ์†Œํ”„ํŠธ์›จ์–ดํ•™๊ณผ</option>
    	<option>๊ตญ๋ฌธ๊ณผ</option>
</select>
	</fieldset>
     
     <fieldset>
     	<legend>์žฅ์ </legend>
     	์ทจ๋ฏธ <input type = "text" name = "hobby">
     </fieldset>
<input type = "submit" value = "๊ฐ€์ž…ํ•˜๊ธฐ"><input type = "reset" value = "์ทจ์†Œ">

</form>

</body>


</html>