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

  • Home
  • SEARCH
  • 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 3358320
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:44:19+00:00 2026-05-18T02:44:19+00:00

in the code below, I need to get the ID of the element that

  • 0

in the code below, I need to get the ID of the element that has raised the event

$(document).ready(function () 
{
    $(".selectors").live('change', function () 
    {
        $.post("GetCategoriesByParentId/", { ID: $(this).val() }, function (data) 
        {
            var idd = $(this).attr('id'); //here
        });
    });
});

but the idd is always ‘Undefined’. Why ?

  • 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-18T02:44:20+00:00Added an answer on May 18, 2026 at 2:44 am

    In the context of the $.post callback, the value of this will be set to something different to that of the live call. You’ll need to cache the value of this:

    $(document).ready(function () 
    {
        $(".selectors").live('change', function () 
        {
            var idd = this.id;
    
            $.post("GetCategoriesByParentId/", { ID: $(this).val() }, function (data) 
            {
                // idd is now the id of the changed element
            });
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the code shown below, I need to manipulate the time var in python
In the code given below, I need to position the userid box in the
The code shows below what i have done till now. Now what i need
In the code snippet below, from my jQuery setup, I need to check if
I am new to linq. My code is as below . I need to
I need the java code snippet for the below logic: Following is a string
Ok, I have an in template function that get's submitted via method=POST. But I
I have written such the code below that ; I have an array list
we know that we can block any element using jQuery BlockUI. like the below
I created a code below, where I need to keep track of an array,

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.