Possible Duplicate:
jQuery $(this) vs this
When using jQuery, whats the difference between this and $(this)?
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.
Generally, use $(this) when you’re going to follow it up with another jquery function for a wrapped set. Use this when you’re trying to access an element (such as .name) from the DOM.
An example of some code I have that adds another row to a table, based on a model row that is somewhere else, hidden in the form and not visible. The code below uses both $(this) and this, in different contexts.