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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:05:01+00:00 2026-06-07T14:05:01+00:00

I’ve been having a hard time getting the right selector and I’ve just now

  • 0

I’ve been having a hard time getting the right selector and I’ve just now got it working by doing .parent().parent().siblings() , but I know there has to be a better way to get it without chaining it so much.

The div is added dynamically and this is the only reliable way I’ve found to select it:

var current = $(".filename:contains('" + file.name + "')").parent().parent().siblings();
current.find("input[name=title]").val(obj.file_name);

This is the jsFiddle link: http://jsfiddle.net/Msnf9/8/

This is the HTML:

<div id="uploadifive-fileupload-queue" class="uploadifive-queue">
    <div class="uploadifive-queue-item" id="uploadifive-fileupload-file-0">
        <div class="span12 well">
            <div class="row-fluid">
                <div class="alert">
                    <div class="filename">file-name-1.jpg</div>
                    <div class="fileinfo"> - Completed</div>
                </div>
                <div class="progress">
                    <div class="bar"></div>
                </div>
            </div>

            <div class="row-fluid inputs">
                <div class="span3">
                <ul class="thumbnails">
                    <li class="span12">
                      <a href="#" class="thumbnail">
                        <img src="http://placehold.it/260x180" alt="">
                      </a>
                    </li>
                  </ul>
                </div>
                <div class="span9">
                    <form class="form-horizontal">
                        <fieldset>
                            <div class="control-group">
                                <label class="control-label" for="file-name">File Name</label>
                                <div class="controls">
                                    <span class="input-xlarge uneditable-input file-name" /></span>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label" for="file-dimensions">File Dimensions</label>
                                <div class="controls">
                                    <span class="input-xlarge uneditable-input file-dimensions" /></span>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label" for="file-url">File URL</label>
                                <div class="controls">
                                    <span class="input-xlarge uneditable-input file-url" /></span>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label" for="alt-text">Alt Text</label>
                                <div class="controls">
                                    <input type="text" class="input-xlarge" placeholder="Alt text" name="alt-text" id="alt-text" />
                                </div>
                            </div>
                            <input type="hidden" name="image_id" />
                            <div class="form-actions">
                                <button id="save" type="button" class="btn btn-primary"><i class="icon-ok icon-white"></i> Save</button>
                                <button id="delete" type="button" class="btn btn-inverse"><i class="icon-trash icon-white"></i> Delete</button>
                         </fieldset>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
  • 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-07T14:05:03+00:00Added an answer on June 7, 2026 at 2:05 pm

    Use closest() method, it gives you closest ancestor of the element in the DOM. As you have class row-fluid with the desired parent which is used to reach the desired parent.

    Live Demo

    var current = $(".filename:contains('file-name-1.jpg')").closest('.row-fluid').siblings();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
i got an object with contents of html markup in it, for example: string

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.