jQuery w3schools 한글판 강좌22 - Commonly Used jQuery Event Methods - focus(), blur() > 개발자팁

개발자팁

개발과 관련된 유용한 정보를 공유하세요.
질문은 QA에서 해주시기 바랍니다.

jQuery w3schools 한글판 강좌22 - Commonly Used jQuery Event Methods - focus(), blur() 정보

jQuery jQuery w3schools 한글판 강좌22 - Commonly Used jQuery Event Methods - focus(), blur()

본문

focus()

focus() 메소드는 한개의 HTML폼 필드에 하나의 이벤트 핸들러함수를 붙여주며,

그 함수는 폼 필드가 focus를 획득할때 실행됩니다.

Example

$("input").focus(function(){
    $(this).css("background-color""#cccccc");
});

blur()

blur() 메소드는 하나의 HTML 폼필드에게 하나의 이벤트 핸들러 함수를 붙여줍니다.

그 함수는 그 폼필드가 포커스를 상실할때 실행됩니다

 

Example

$("input").blur(function(){
    $(this).css("background-color""#ffffff");
});
추천
0
  • 복사

댓글 0개

© SIRSOFT
현재 페이지 제일 처음으로