본문 바로가기
WEB Archive

[HTML] input 태그의 속성 살펴보기

by universedevelope 2024. 8. 19.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Test017.html</title>
</head>
<body>

<div>
	<h1>한 줄 데이터 입력상자 / 암호 입력 상자</h1>
	<hr>
</div>

<div>
	<form>
		회원아이디 <input type = "text" name = "name" size = "10"
		           maxlength = "8" placeholder = "ex) superman"><br>
		패스워드 <input type = "password" name = "pwd" size = "10"
		          maxlength = "10"> <br>           
		
	</form>
</div>

<!-- maxlength 활용 -->

<div>
	<form>
		휴대폰 번호<input type = "text" name = "phone1" size = "5" maxlength = "3">
		 - <input type="text" name = "phone2" size = "6" maxlength="4">
		 - <input type = "text" name = "phone3" size = "6" maxlength = "4">
	</form>
	
</div>

</body>
</html>

글을 입력할 수 있는 input 태그의 text 속성은 일반적인 로그인, 회원가입과 관련한
각종 사이트에서 볼 수 있는 모습을 띈다.

password 속성은 암호가 입력되듯 나타난다.

728x90

댓글