제이쿼리 질문
본문
$('input[type="text"]').each(function(){
this.value = $(this).attr('title');
$(this).addClass('text-label');
$(this).focus(function(){
if(this.value == $(this).attr('title')) {
this.value = '';
$(this).removeClass('text-label');
}
});
$(this).blur(function(){
if(this.value == '') {
this.value = $(this).attr('title');
$(this).addClass('text-label');
}
});
});
제이쿼리 문법을 잘 몰라서 질문 드립니다.
맨 상단에 'input[type="text"]' 이 부분 말입니다.
인풋 타입이 text 랑 password가 있는데, password 타입도 적용시키고 싶은데
어떻게 같이 묶을 수 있을까요?
답변 부탁드리겠습니다.
!-->
답변을 작성하시기 전에 로그인 해주세요.