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

[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>

 

 


분류 제목
formatting HTML - <rb> 태그 ★ - 상단주석 붙일 기본글자 (= rb태그 = 알비태그)
image HTML - <figcaption> 태그 - 독립콘텐츠제목 (= figcaption태그 = 피그캡션태그) (…
media HTML - <track> 태그 - 미디어트랙정보 (= track태그 = 트랙태그)</tr>
attribute HTML - size 속성 ★ - (INPUT 입력창크기 / SELECT 기본노출옵션개수) 지정 (= siz…
basic HTML - <hgroup> 태그 - <h1>~<h6> 제목 묶기 (= 제목그룹 = hgroup태그 = 에이…
formatting HTML - <rt> 태그 ★ - 글자 상단 주석 내용 (= rt태그 = 알티태그)
formatting HTML - <rp> 태그 - 글자 상단 주석 안 먹힐 때 보여줄 내용 (= rp태그 = 알피태그)
formatting HTML - <bdi> 태그 - 글자 양방향 인식 (= 글자방향 = bdi태그 = 브디태그)
attribute HTML - download 속성 - 파일 다운로드 지정 (= download속성 = 다운로드속성) ※ 다운…
style HTML - <article> 태그 ★ - 자족적인 독립콘텐츠 (= 아티클태그 = article태그. IE9…
api HTML5 - Web Storage - 웹저장소 (= 웹스토리지) (IE8 이상) ※ 마우스 클릭횟수 점검
image HTML - <figure> 태그 - 독립콘텐츠표시 (= figure태그 = 피겨태그)
formatting HTML - <time> 태그 - 브라우저 인식 가능 날짜시간 지정 (= time태그 = 타임태그, IE9)
formatting HTML - <meter> 태그 - 게이지바 (= meter태그 = 미터태그)
intro HTML - 구형브라우저에서 HTML5 사용 (+ HTML요소생성법)
list HTML - <dt> 태그 ★ - 설명리스트의 설명항목 (= dt태그 = 디티태그) ※ (정의리스트/데이터리…
formatting HTML - <mark> 태그 - 형광펜칠하기 (= mark태그 = 마크태그) (HTML5추가, IE9 이상…
style HTML - <section> 태그 ★ - 연관된 문서단락 (= section태그 = 섹션태그, IE9)
api HTML5 - Geolocation - 사용자위치 (= 사용자 지리위치 = 지오로케이션)
formatting HTML - <samp> 태그 - 프로그램산출예제. (= 샘프태그 = 샘플태그 = samp태그)
11/18
목록
찾아주셔서 감사합니다. Since 2012