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

[attribute] HTML - autofocus 속성 - 포커스 자동 여부 지정 (= autofocus속성 = 오토포커스속성)

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

 

autofocus 예제 - <input> 경우

 

<form action="/action_page.php">

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

  <input type="text" id="name" name="name" autofocus><br>

  <label for="nick">별명:</label>

  <input type="text" id="nick" name="nick"><br>

  <input type="submit">

</form>

 

 

autofocus 정의

 

페이지 로드 시, 해당 요소에 포커스 줄지 여부 지정하는 참거짓 속성.

 


 

1. autofocus 사용 가능 태그

<button>, <input>, <select>, <textarea>

 

2.

autofocus 속성 갖는 요소는 검고 굵은 테두리 갖음.

 

3.

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

단, Firefox 브라우저는 <select> 태그 지원 X

 

 

autofocus 구문

 

  • <button type="button" autofocus>
  • <input autofocus>
  • <select autofocus>
  • <textarea autofocus>

 


[속성값]

 

없음.

 

 

autofocus 예제 - <button> 경우

 

<button type="button" autofocus onclick="alert('홈짱닷컴 Homzzang.com')">클릭</button>

 

 

autofocus 예제 - <select> 경우

 

<form action="/action_page.php">

  <label for="hz">좋아하는 언어:</label>

  <select name="hz" id="hz" autofocus>

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

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

    <option value="js">JS</option>

  </select>

  <br><br>

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

</form>

 

 

autofocus 예제 - <textarea> 경우

 

<textarea rows="3" cols="30" autofocus>

홈짱닷컴 Homzzang.com (홈페이지 제작관리 강의)

</textarea>

 

 


분류 제목
attribute HTML - preload 속성 - 페이지 로드 시, (오디오/비디오) 미디어파일을 로드할지 여부와 방법을 …
attribute HTML - readonly 속성 - 읽기전용 설정 (= readonly속성 = 리드온리속성) ※ (읽기만 …
attribute HTML - rel 속성 ★ - 링크문서가 현재문서와 어떤 관계인지 지정 (= rel속성 = 릴속성/렐속성)
attribute HTML - required 속성 ★ - 폼데이터 제출 전 (입력필수/선택필수) 지정 (= required속…
attribute HTML - reversed 속성 - 순서있는 리스트 스타일 타입을 역순(=내림차순)으로 표시 (= reve…
attribute HTML - rows 속성 - <textarea> 가로행수(=가로줄수=가시높이) 지정 (= rows속성 = …
attribute HTML - rowspan 속성 ★ - 테이블셀 가로행 병항 (= 가로줄 병합 = rowspan속성 = 로우…
attribute HTML - sandbox 속성 ★ - iframe태그에 삽입된 웹페이지에 제한 걸거나 특정 기능 허용 지정…
attribute HTML - scope 속성 - <th> (테이블헤더셀)의 범위 지정 (= scope속성 = 스코우프속성/스…
attribute HTML - selected 속성 ★ - 실렉트태그 기본 선택 옵션 지정 (= selected속성 = 실렉티…
attribute HTML - shape 속성 - 이미지맵 링크영역 모양 지정 (= shape속성 = 쉐이프속성) ※ 에어리어…
attribute HTML - size 속성 ★ - (INPUT 입력창크기 / SELECT 기본노출옵션개수) 지정 (= siz…
attribute HTML - sizes 속성 - 해상도별 이미지나 아이콘, 미디어(오디오/비디오) 등의 크기 지정 (= si…
attribute HTML - span 속성 ★ - 테이블 (열/열그룹) 병합 개수 지정 (= span속성 = 스팬속성) ※ …
attribute HTML - spellcheck 속성 - 맞춤법 검사 (= 철자 검사 = spellcheck속성 = 스펠체크…
attribute HTML - src 속성 ★ - 외부 리소스 URL주소 지정 (= src속성 = 에스알시속성/에스알씨속성/소…
attribute HTML - srcdoc 속성 - 아이프레임(iframe) src 속성 내용 대체할 태그내용 지정 (= sr…
attribute HTML - srclang 속성 - 트랙태그 소스의 언어코드 지정 (= srclang속성 = 에스알시랭속성/…
attribute HTML - srcset 속성 - 다른 환경에서 적용할 이미지소스 지정 (= srcset속성 = 에스알시셋속…
attribute HTML - start 속성 - 순서있는 리스트 시작값 설정 (= start속성 = 스타트속성) ※ 오엘태그…
8/9
목록
찾아주셔서 감사합니다. Since 2012