What is difference between $(this) and ‘this’ in jquery?



What is difference between $(this) and ‘this’ in jquery?..

Answer / Santosh Pankholi

In jQuery, $(this) refers to the current element in the context of a DOM event or method. It wraps the current HTML element in a jQuery object. On the other hand, 'this' without the dollar sign refers to the global object (in most cases, the window object), unless it is used inside an object literal, function, or jQuery object where it refers to the specific object or function.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More jQuery Interview Questions

How we can select multiple elements in jquery?

1 Answers  


What are the various ajax functions available in jquery ?

1 Answers  


How can jquery be used in conjunction with another javascript library that also uses $ for naming?

1 Answers  


Explain the difference between .empty() and .remove() ?

1 Answers  


What are selectors in jquery?

1 Answers  


Define slidetoggle() effect?

1 Answers  


What is a cdn? : jQuery Mobile

1 Answers  


How to validate email using jquery?

0 Answers  


What is the basic need to start with jQuery?

1 Answers  


What is the use of jquery .each() function?

1 Answers  


What is chaining in jQuery?

1 Answers  


Which command will give a version of jQuery?

1 Answers  


Categories