HTML

[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 - <wbr> 태그 - 한 단어 내 줄바꿈 위치/지점 표시 (= wbr태그 = 더블유비알태그)
form HTML - <datalist> 태그 - 입력가능값리스트 (= datalist태그 = 데이터리스트태그)
form HTML - <keygen> 태그 - 암호화쌍키생성 (= keygen태그 = 키젠태그)
form HTML - <output> 태그 - 계산 결과값 출력 (= output태그 = 아웃풋태그)
image HTML - <canvas> 태그 - 그림그리기 (= canvas태그 = 캔버스태그)
image HTML - <svg> 태그 - 그림그리기 (= 동적그림 = svg태그 = 에스브이지태그)
image HTML - <figure> 태그 - 독립콘텐츠표시 (= figure태그 = 피겨태그)
image HTML - <figcaption> 태그 - 독립콘텐츠제목 (= figcaption태그 = 피그캡션태그) (…
media HTML - <audio> 태그 ★ - 음성파일재생 (= audio태그 = 오디오태그)
media HTML - <source> 태그 - 미디어소스 불러오기 (= source태그 = 소스태그)
media HTML - <track> 태그 - 미디어트랙정보 (= track태그 = 트랙태그)</tr>
media HTML - <video> 태그 ★ - 영상재생 (= video태그 = 비디오태그) ※ 영상파일형식별로 브…
link HTML - <nav> 태그 ★ - 네비게이션링크모음 (= nav태그 = 네브태그)
list HTML - <menuitem> 태그 - 마우스오른쪽 팝업메뉴 (= menuitem태그 = 메뉴아이템태그) …
style HTML - <header> 태그 ★ - 단락머리말 (= header태그 = 헤더태그 = 헤더요소) (HT…
8/24
목록
 홈  PC버전 로그인 일본어
그누앞단언어
그누뒷단언어
그외코딩언어
그누보드
제작의뢰
Q&A
커뮤니티
웹유틸
회원센터
홈짱닷컴 PC버전 로그인