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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:13:33+00:00 2026-06-10T00:13:33+00:00

I am having trouble getting an ID of an element. The codes work in

  • 0

I am having trouble getting an ID of an element. The codes work in FF and chrome but not IE.
Can anyone help me about it? Thanks a lot

<td id='tdID'>
    <img id='test' src='a.jpg' class='imgClass' />
</td>

jquery

$('.imgClass').click(function(){
   ip=$(this).parent().attr('id');          

   //undefined in IE
   console.log(ip);
})
  • 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-06-10T00:13:34+00:00Added an answer on June 10, 2026 at 12:13 am

    <td>s must be inside a <table>. If they are not, most browsers will remove them from the DOM. So, the $(this).parent() might not be the element you think.

    Here’s a quick demo: http://jsfiddle.net/NTICompass/cyK3h/

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

Sidebar

Related Questions

I'm having trouble getting this to work. It validates the fields as expected, but
I'm having trouble getting IE to not display a background of a child element
I'm having trouble getting the CanExecute method of my command to work property. I've
I am having trouble getting my application to work correctly. I am trying to
I'm having trouble getting nested areas to work. I would like to use a
I'm having trouble getting my CSS to work :( HTML <form action=/api/submit/ method=post> <textarea
I'm trying to access the number in the below element, but I'm having trouble
I'm having some trouble getting a jQuery plugin to work correctly in my MVC
I'm having trouble getting the Jquery Validation to work with the following rules. I
I am having trouble getting jquery to recognize an element that is created from

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.