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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:45:07+00:00 2026-05-24T13:45:07+00:00

In jQuery 1.3.2 – jQuery(‘#id’).data(elem) returned the id ? I’m wondering how to do

  • 0

In jQuery 1.3.2 – jQuery('#id').data(elem) returned the id ? I’m wondering how to do the same thing using jQuery 1.6.2 ?

Understanding now is that it returns the object as opposed to the id as it was in jQuery 1.3.2 ?

How can I get the id ?

Edit: sorry for not clarifying – the .data key/value pair – because I’m upgrading from 1.3.2 and .data(elem) is no longer returning the ID – and im unsure how to get it using 1.6.2 ?

  • 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-24T13:45:08+00:00Added an answer on May 24, 2026 at 1:45 pm

    Your question shows:

    jQuery('#id').data(elem)
    

    But I assume this does not reflect what you actually want.

    I’m guessing you’re really doing:

    jQuery.data( elem )
    

    As in:

    var elem = $('#test');
    
    alert( $.data( elem ) );
    

    Example: http://jsfiddle.net/Xd3km/

    …which (in jQuery 1.3.2) does not give the ID of the element, but rather the ID representing the element in jQuery.cache.

    I’m pretty sure you can’t do this as of jQuery 1.4. Furthermore, I’m not sure why this number would be useful. Especially since the structure of jQuery.cache is meant for internal use, and is subject to change.

    Doing jQuery.data( elem ) now gives you the data object associated with that element in jQuery.cache. It should provide anything that is really useful to you.

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

Sidebar

Related Questions

JQuery events are annoying me. The thing is that I very often use javascript
Jquery has a great language construct that looks like this: $(document).ready(function() { $(a).click(function() {
jQuery hyperlinks - href value? text][1] I am running in to a problem using
jQuery 1.7.1 - I'm using jQuery tabs widget in my JSP and have the
jQuery Mobile Docs says if we wrap form element in div containing data-role=fieldcontain proper
jQuery.get(window.location.href, function(data) { alert(data); alert($(data).html()); }); The first popup is all the HTML good
JQuery's sortable has an option to revert the item that the user drags back
Jquery Mobile Transition effects have a clumsy behavior in Android PhoneGap app.The same transitions
jQuery's effects are great, but I've noticed that the remaining elements under the affected
jQuery File Uploader: https://github.com/blueimp/jQuery-File-Upload I'm using the plugin above. How in jQuery can I

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.