Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1057901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:56:35+00:00 2026-05-16T17:56:35+00:00

What is the fundamental difference between using $(this) vs this $(‘.viewComments’).click(function(ev){ //returns the desired

  • 0

What is the fundamental difference between using $(this) vs this

$('.viewComments').click(function(ev){
    //returns the desired value
    alert(this.getAttribute('id'));

    //Gives an error sayin function is not defined 
    alert($(this).getAttribute('id'));

    //returns the desired value
    alert($(this).attr('id'));
});

What I thought was “$(this)” will contain all functions that “this” has and more..But that doesn’t seem to be the case.

So what exactly is $(this)? and

Hw do I know what functions are available when I’m using it? (I know I can get them through firebug. but I would like to know if there any some other way- some doc may be)

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:56:36+00:00Added an answer on May 16, 2026 at 5:56 pm

    this is the DOM object, whereas $(this) is the jQuery wrapper around same.

    When using this, you can call DOM methods on it, but not jQuery methods. When using $(this), you can call jQuery methods on it, but not DOM methods.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a fundamental difference in terms of performance with regards to using BETWEEN
From this wikipedia page: The fundamental difference between context-free grammars and parsing expression grammars
Could someone explain the fundamental difference between: define(['backbone'], function(Backbone) { MyModel = Backbone.Model.extend({ });
What is the fundamental difference between the two? On the server side on the
What is the fundamental difference between quicksort and tuned quicksort? What is the improvement
Is there a fundamental difference between how position:fixed; is handled by Firefox 3.0 and
What is the fundamental difference between Add & Commit in Solr? We have read
What's the fundamental difference between them? Is a UITextField that's not editable is effectively
I just have discovered the fundamental difference between two input forms for floating-point numbers:
The wikipedia article on PEG states: The fundamental difference between context-free grammars and parsing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.