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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:18:33+00:00 2026-05-28T14:18:33+00:00

My javascript runs like this on firebug: tr=$(this).parent(‘tr’); tr.find(‘.img-delete’).css(‘display’,’block’); but I can’t see the

  • 0

My javascript runs like this on firebug:

 tr=$(this).parent('tr');
 tr.find('.img-delete').css('display','block');

but I can’t see the change on the browser. Is there anything I can do to make it shown?

Update:

First I didn’t know (or remember) it should show as soon as the change made. I have UI items on a thickbox, I was able to catch events of the items in the window and changed css accordingly. But it didn’t show. So my question goes.

  • 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-28T14:18:34+00:00Added an answer on May 28, 2026 at 2:18 pm

    Because, in this instance, you’re responding to an event on an element within a table-cell, may I suggest (as related in the comments to your question):

    $(this).closest('tr').find('.img-delete').show();
    

    JS Fiddle demo/proof-of-concept.

    I’ve switched from parent() to closest(), as parent() only looks at the immediate parent, rather than working its way up the DOM tree of the element’s ancestor elements. As the parent of the input is not, and cannot, in valid HTML, be, the tr element parent() will return a null, undefined or false (or falsey) value, rather than an element to work upon.

    The reason I suggest closest(), as opposed to parents() is that closest() stops at the first element that matches the selector, and therefore returns a single element, whereas parents() continues up the DOM tree of the element’s ancestors and returns, potentially, multiple elements in an array.

    As you’re likely to want to act upon only a single element, closest() seems a better match.

    References:

    • closest().
    • find().
    • parents().
    • show().
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a recursive type function in Javascript that runs like this: function loadThumb(thumb)
I have a JavaScript snippet that runs very well on Firefox and Safari, but
My script currently looks like this: <script type=text/javascript> function updateMe(){ var x = 0;
i have html code block like this <div id=some-div> <a href=# class=link-click>some link text</a>
<a href=tags.php onclick=return popitup('tags.php')>tags</a> I have this line of code that runs the javascript
I have a code like this : <script type=text/javascript> var currentPicture;//default picture var picEL;//the
I wrote a tab system using some very basic Javascript and it runs like
I've read about Orto, a Java virtual machine that runs on Javascript, but I
I have some javascript that is embedded in the html file like this <html>
If I write some JavaScript that runs in an <iframe> (which is dynamically created

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.