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 419025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:44:12+00:00 2026-05-12T18:44:12+00:00

A common issue I have is getting confused what $(this) is referring to. I

  • 0

A common issue I have is getting confused what $(this) is referring to.

I often will try to give it some odd style:

$(this).css("border","10px solid red")

Which helps sometimes.

I’m stumped with the following however. My question can maybe be answered in two ways:

1) is there a universal way to ‘see’ what $(this) is referring to in any given situation? Perhaps in combination with firebug?

2) more specifically, any idea what $(this) should be referring to in this sample below? I assumed it would have been the input with a class of btnSave but doesn’t seem to be:

$(ajaxContainer).find("input.btnSave").click(function(){
    savePanel();
});

function savePanel() {
    $(this).css("border","10px solid red");
};
  • 1 1 Answer
  • 0 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-12T18:44:13+00:00Added an answer on May 12, 2026 at 6:44 pm

    1) Use the console in Firebug:

    var obj = $(this);
    console.log(obj);
    

    2) savePanel() won’t have the context correct to use $(this). You could try:

    $(ajaxContainer).find("input.btnSave").click(function(){
        $(this).css("border", "10px solid red");
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this common issue of 'new line' in php-csv which is making me
I have looked up this error, and it seems the common issue is caused
This seems to be a common issue, and the solutions which I have seen
I have a pretty common layout issue that I have traditionally used a table
Considering it's a common issue, what could be the source of this error if
This seems like it would be a common issue to be but I don't
So I know this is a common problem and have seen a lot of
I know this is a common issue faced by beginners in EF and there
I am getting a issue with NSMutableArray . I have used that to store
I'm getting some unexpected results calling one makefile from another. I have two makefiles,

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.