Mr.P's blog
기억은 사라지지만 기록은 남는다.
2014/05/02
[jQuery] div객체에 focus지정하기
출처 :
http://stackoverflow.com/questions/5594431/jquery-focus-not-working-without-tabindex-attribute-of-div
개요 : div객체는 focus를 받기 전에 tabindex가 지정되어야 하는데, div객체에 속성으로 tabindex를 할당하지 않고 jQuery로 tabindex를 지정한 뒤 focus function을 호출하면 됨.
$("#div_id").attr("tabindex", -1).focus();
또는
$("#div_id").attr("tabindex", -1).focus({
//do...
});
댓글 없음:
댓글 쓰기
최근 게시물
이전 게시물
홈
피드 구독하기:
댓글 (Atom)
댓글 없음:
댓글 쓰기