• 회원가입
  • 로그인
  • 구글아이디로 로그인

[attribute] HTML - required 속성 ★ - 폼데이터 제출 전 (입력필수/선택필수) 지정 (= required속성 = 리콰이어드속성)

목차
  1. required 예제 - <input> 경우
  2. required 정의
  3. required 구문
  4. required 예제 - <select> 경우
  5. required 예제 - <textarea> 경우

 

required 예제 - <input> 경우

 

<form action="/action_page.php">

  <label for="name">이름:</label>

  <input type="text" id="name" name="name" required>

  <input type="submit">

</form>

 

결과보기

 

required 정의

 

폼데이터 서버에 제출 전 (입력필수/선택필수) 지정하는 참거짓 속성.

 


 

1. required 속성 사용 가능 태그 종류

<input>, <select>, <textarea>

  • <input> 태그 중 required 속성 사용 가능 type 종류: text, search, url, tel, email, password, date pickers (즉, date, datetimel-local, month, time, week) , number, checkbox, radio, file

 

2. 

IE10 이상 주요 최신 브라우저 모두 지원.

 

 

required 구문

 

  • <input type="supportType" required>
  • <select required>...</select>
  • <textarea required>...</textarea>

 


[속성값]

 

없음.

 

 

required 예제 - <select> 경우

 

<form action="/action_page.php">

  <label for="langs">언어선택:</label>

  <select name="langs" id="langs" required>

    <option value="">언어종류</option>

    <option value="html">HTML</option>

    <option value="css">CSS</option>

    <option value="javascript">JavaScript</option>

    <option value="jquery">jQuery</option>

  </select>

  <input type="submit" value="확인">

</form>

 

결과보기

 

required 예제 - <textarea> 경우

 

<form action="/action_page.php">

    <textarea rows="4" cols="30" name="self" required></textarea>

    <input type="submit">

</form>

 

결과보기

 


분류 제목
attribute HTML - step 속성 - 입력 가능 숫자 간격 설정 (= step속성 = 스텝속성) ※ 입력 가능 배수…
attribute HTML - style 속성 ★ - 인라인 스타일 지정 (= style속성 = 스타일속성)
attribute HTML - tabindex 속성 - 탭색인번호 지정 (= tabindex속성 = 탭인덱스속성) ※ 탭넵비게…
attribute HTML - target 속성 ★ - (링크된 문서 열 곳 / 폼 제출할 곳) 지정 (= target속성 =…
attribute HTML - title 속성 ★ - 요소애 대한 추가 정보 지정 (= title속성 = 타이틀속성)
attribute HTML - translate 속성 - 요소 내용 번역 허용 여부 지정 (= translate속성 = 트랜슬…
attribute HTML - type 속성 ★★★ - 요소 타입 지정 (= type속성 = 타입속성)
attribute HTML - usemap 속성 - 이미지를 이미지맵으로 지정 (= usemap속성 = 유즈맵속성|유스맵속성)
attribute HTML - value 속성 ★★★ - 요소값 지정 (= value속성 = 밸류속성) ※ 초기값/기본값/현재…
attribute HTML - width 속성 - 너비 지정 (= width속성 = 위드스속성) ※ 가로길이 설정
attribute HTML - wrap 속성 - FORM 제출 시, TEXTAREA 텍스트 감싸기 (= wrap속성 = 랩속성…
attribute HTML - rev 속성 - (HTML5 지원 X) 현재 웹문서가 타웹문서와 어떤 관계인지 지정 (= re…
attribute HTML - formtarget 속성 - 폼데이터 전달할 폼 지정 (= formtarget속성 = 폼타겟속성…
attribute HTML - minlength 속성 ★ - 입력 가능한 최소 글자 개수 지정 (= minlength속성 =…
attribute HTML - on으로 시작하는 속성에서 2개 이상의 여러 JS함수 실행 방법
attribute HTML - loading 속성 - 이미지 레이지로드 여부 지정 (= loading속성 = 로딩속성) ※ …
attribute HTML - cellspacing 속성 - 테이블셀간의 간격 지정 (= cellspacing속성 = 셀스페이…
attribute HTML - cellpadding 속성 - 테이블 셀 내부의 여백 지정 (= cellpadding속성 = 셀…
9/9
목록
찾아주셔서 감사합니다. Since 2012