div 객체에 focus 지정 (포커스) > jquery

본문 바로가기

jquery

div 객체에 focus 지정 (포커스)

작성일 18-11-20 11:09

페이지 정보

작성자서방님 조회 377회 댓글 0건

본문

div 객체는 focus 를 받기 전에 tabindex 가 지정되어야 하는데,

div 객체에 속성으로 tabindex 를 할당하지 않고,

jQuery 로 tabindex 를 지정한 뒤 focus function 을 호출하면 됨.


$("#div_id").attr("tabindex", -1).focus();


또는


$("#div_id").attr("tabindex", -1).focus({
	// do...
});

댓글목록

등록된 댓글이 없습니다.

게시물 검색
Copyright © 서방님.kr All rights reserved.
PC 버전으로 보기