Dear all I have some class like this
<div class = "student">
<div class = "name">Adam </div>
<input class = "paperTaken">
</div>
<div class = "student">
<div class = "name">Smith</div>
<input class = "paperTaken">
</div>
When I put the cusor on an input field (say, "paperTaken" in the first "student" class), I can get the corresponding value in class "name" (eg: Adam).
Could you help me? Thank you in advance.
P/S:
Actually I used it for autoComplete with the Jquery Autocomplete Plugin , so I must listen to paperTaken for autocomplete
$(function(){
autoComplete();
}
function autoComplete() {
//This will result list of papers that StudentName take
$(".paperTaken").autocomplete(baseUrl+"/autocomplete.php?student=StudentName
... }
I want to get the student name to put into the request for autocomplete. So I tried to apply your suggestion using
$('.paperTaken').focus(function() {
...
}
But it's seem that not work.
I'm wondering if the "papertaken" was already listened by autocomplete, can it listen to the "focus" call?