Please look at this fiddle: http://jsfiddle.net/DHts6/1/
Why does it say undefined, even though the id = "foo" is set!
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You don’t need
$(this).id, just dothis.id.Reason for this is that
$creates a jQuery object that doesn’t have.idproperty. In jQuery you would use attr$(this).attr('id')http://jsfiddle.net/DHts6/5/