2010-12-16 6 views
-1

다음 HTML이 있습니다.간단한 jquery 질문

<input type="text" class="embeddedLabel" /> 

내가 가진 텍스트 상자의 포커스 이벤트에 함수를 묶어 할 ...

$(document).ready(function(){ 
    $(input[@class = 'embeddedLabel'].focus(function(){ 
     alert('embeddedLabel textbox found'); 
    }); 
}; 

그러나, 나는이 일을 할 수 없습니다. 텍스트 상자를 클릭하면 경고 메시지가 표시되지 않습니다. 그 문제가 여기에있는 것이 누구에게나 명백합니까?

답변

2

당신은 어떤 따옴표를 놓친 : 나는 따옴표뿐만 아니라 표현의 끝에 괄호 누락 된

$("input[@class = 'embeddedLabel']") 
+0

. 팁을위한 Thx ... –

0

이 시도 :

$(document).ready 
(
    $(input[@class = 'embeddedLabel']).bind("focus",function(){ 
     alert('embeddedLabel textbox found'); 
    }); 
};