0 votes
in jQuery by

What is the difference between $(this) and this keyword in jQuery?

1 Answer

0 votes
by (4.4k points)

There are following difference between $(this) and this keyword in jQuery.

This is very tricky question for jQuery beginners. $(this) returns a jQuery object, on which you can call several jQuery methods e.g. text() to retrieve text, val() to set and retrieve value etc, this represent current element, and it is one of the JavaScript keyword to denote current DOM element in a context. You can not call jQuery method on this, until it’s wrapped using $() function i.e. $(this).

Share:- Whatsapp Facebook Facebook

Welcome to Developerhelpway Q&A, where you can ask questions and receive answers from other members of the community.