javascript - What is the difference between “this”, “$this” and “$(this)”? -


what difference between these 3 forms:

this $this $(this) 

in typical usage you'll see them (the $this usage may vary):

  • this - refers dom element in handler you're on, may object entirely in other situations, it's context.
  • $this - created var $this = $(this) cached version of jquery wrapped version efficiency (or chain off $(this) same in many cases).
  • $(this) - jquery wrapped version of element, have access all methods (the ones in $.fn specifically).

Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -