simple jquery question [closed]
I have the following HTML.
<input type="text" class="embeddedLabel" />
And I wish to tie a function to the f开发者_C百科ocus event of the textbox with...
$(document).ready(function(){
$(input[@class = 'embeddedLabel'].focus(function(){
alert('embeddedLabel textbox found');
});
};
However, I can't make this work. The alert never fires when I click in the textbox. Is it obvious to anyone what the issue is here?
You're missing some quotes:
$("input[@class = 'embeddedLabel']")
Try this:
$(document).ready
(
$(input[@class = 'embeddedLabel']).bind("focus",function(){
alert('embeddedLabel textbox found');
});
};
精彩评论