<form></form>

<form action="#" method="get">
    <label>검색할 내용: </label><input type="text" name="search"> &nbsp;
    <input type="submit" value="검색">
</form>

Untitled

submit 버튼을 눌렀을 때 action에 지정한 경로로 method에 지정한 방식으로 input태그 값을 전달한다.

<filedset></filedset>, <legend></legend>

<form>
        <fieldset>
            <legend>필드셋의 제목을 작성하는 부분이다.</legend>
            <label>입력1: </label><input type="text"><br>
            <label>입력2: </label><input type="text"><br>
            <label>입력3: </label><input type="text"><br>
        </fieldset>
</form>

Untitled

[ 속성값 설정 ]

type = “ text “

type = “ password ”

<label for="uid">아이디: </label>
<input type="text" id="uid" name="userId" size="80" 
placeholder="아이디를 입력하세오" value="하이미디어">
<br>
<label>비밀번호: </label>
<input type="password" name="userpwd"
placeholder="비밀번호를 입력하세요.">

→ placeholder로 텍스트창에 안내문구를 작성할 수 있다.

type = "search", type = "url, type = "email", type = "tel”

 <input type="search" name="searchtext" placeholder="검색할 내용 입력하세요."><br>
 <label >홈페이지: </label>
 <input type="url" name="homepage" value="https://" required><br>
 <label >이메일: </label>
 <input type="email" name="email" placeholder="이메일을 입력하세요."><br>
 <label >전화번호: </label>
 <input type="tel" name="phone" placeholder="전화번호를 입력하세요."><br>

Untitled

[ 숫자 관련 input 태그 ]

type = "number”

type = "range”

<label>수량</label>
<input type="number" name="amount" min="1" max="100" value="0" step="5">
<!--  최솟값은 1, 최댓값은 100일때, 5단위로 증가, 초기값 0설정-->

****<label>점수: </label>
<input type="range" name="point" min="0" max="100" value="50" step="10">
<input type="submit"> &nbsp; <input type="reset" value="취소">
<!-- 최솟값은 0, 최댓값은 100일때 10단위로 설정가능, 초기값은 50설정 -->

[ 날짜 /시간과 관련된 input 태그 ]

type = "date", type = "month", type = "week", type = "time", type = "datetime-local”

date → 년, 월, 일 선택 양식을 생성

month → 년, 월 선택 양식을 생성

week → 주 선택하는 양식 생성

datetime-local → 년, 월, 일 시간 선택 양식 생성

<label>date: </label><input type="date" name="date"><br>
<label>month: </label><input type="month" name="month"><br>
<label>week: </label><input type="week" name="week"><br>
<label>time: </label><input type="time" name="time"><br>
<label>datetime-local</label><input type="datetime-local" name="datetime-local"><br>

Untitled

[ 라디오 버튼과 체크박스 버튼 ]

type = "radio”, type = "checkbox”

<!-- 라디오 -->
<input type="radio" id="male" name="gender" value="M">
<label for="male">남자</label>
<input type="radio" id="female" name="gender" value="F">
<label for="female">여자</label>
<input type="submit"> &nbsp; <input type="reset" value="취소">
<!-- 체크박스 -->
<input type = "checkbox" id="baseball" name="hobby" value="baseball" checked>
<label for="baseball">야구</label>
<input type = "checkbox" id="football" name="hobby" value="football">
<label for="football">축구</label>
<br>
<input type="submit"> &nbsp; <input type="reset" value="취소">

Untitled

[ 그 밖의 input 태그 ]

type = "color”

type = "file”

type="button”

<label>색상 선택: </label><input type="color" name="color">
<label>파일 선택: </label><input type="file" name="uploadfile" multiple>
<button type="button">버튼</button> &nbsp; <button type="reset">리셋</button>

[ select 태그와 option태그 ]

<label>국적: </label>
<select name="select1">
<option value="ko">한국</option>
<option value="ch">중국</option>
<option value="jp">일본</option>
<option value="etc">기타</option>
<option value="" selected>--</option>
</select>