<input type = "submit" value = "전송">
type을 submit으로 하면 서버로 데이터를 전송하는 버튼을 만들며 value값으로 버튼의 이름을 변경할 수 있다.
<input type = "button" value = "버튼">
<input type="reset">
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<form action="http://localhost/button.php">
<input type="submit" value = "전송">
<input type="button" value = "버튼" onclick="alert('hello world')">
<input type="reset">
</form>
</body>
</html>
hidden field는 눈에 보이지 않지만 몰래 서버쪽으로 데이터를 전송해야할 때 사용한다.
예시
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<form action="http://localhost/button.php">
<input type="submit" value = "전송">
<input type="hidden" name ="hide" value = "password">
</form>
</body>
</html>
label은 무언가의 이름이라는 것을 명시하기 위한 태그이다. 정보의 명시성을 높여준다.
예시
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<form action="http://localhost/label.php">
<label for="id">아이디 : </label>
<input type="text" id = "id" name ="id">
<label>
비밀번호 :
<input type="password" name="pwd">
</label>
<input type="submit">
</form>
</body>
</html>
form 태그의 속성 중 하나.
서버로 정보를 보낼 때 보내는 방법을 설정할 수 있다.
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<form action="http://localhost/label.php" method ="post">
<label for="id">아이디 : </label>
<input type="text" id = "id" name ="id">
<label>
비밀번호 :
<input type="password" name="pwd">
</label>
<input type="submit">
</form>
</body>
</html>
파일을 서버에 업로드 시킬 수 있는 기능
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<form action="http://localhost/upload.php" method ="post" enctype="multipart/form-data">
<input type="file" name="profile">
<input type="submit">
</form>
</body>
</html>