JQuery this,$(this),$this,$()

 

  • this – is a DOM element you assigned the event handler to
  • $(this) – is a jQuery object created from that element
  • $this – is usually used to store the result of $(this)
  • $() function as a shorthand for jQuery()

Example

$("#someElement").click(function() {
    this;    // the element itself
    $(this); // a jQuery wrapper-object around the element
    $this = $(this);
});

Advertisements

Leave a Reply