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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:55:31+00:00 2026-05-27T02:55:31+00:00

Problem:- <div> <div> <div> <select id=s1> …………….. </div> <div> </div> I want to toggle

  • 0

Problem:-

<div>
    <div>
      <div>
        <select id="s1">
           .................
     </div>
   <div>
</div>

I want to toggle the first div, starting from element s1. I can do in this manner:-

$('#s1').parent().parent().parent().toggle(false);

But is there any way i can get to the parent div directly with some shortcut. Is there any way i can avoid using parent() method 3 times ?

Pls suggest.

  • 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-27T02:55:31+00:00Added an answer on May 27, 2026 at 2:55 am

    Try the following:

    $('#s1').parents('div').last();
    

    This will give you the topmost parent div of your select element.
    Alternatively there’s the parentsUntil method, which can be used like so:

    $('#s1').parentsUntil(':not(div)');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a problem. I want to select an element inside a frame (not
I have a problem about div position relative alignment. I want the second div
I have a problem with selecting not first selector using attributeContains jQuery('div[id*=abc]:not(:first)').hide();
I have a problem with IE. I have a fixed div like this: #fixed
This problem is only in IE. Consider the following HTML: <html> <body> <div style='position:absolute;left:1em;right:1em;top:1em;bottom:1em;overflow:auto;>
Ever since switching from TABLE-layout to DIV-layout, one common problem remains: PROBLEM : you
I cannot get the blur() function in the following to work: $('.newselect').focus(function(){ $(this).parent().append('<div class=select_container></div>');
I select some paragraphs inside a div: $('#myDiv p.p1, #myDiv p.p2').text(); My problem is
My Problem was: Add a value to a div element in a dropdown list.
Hi guys i using this jquery to show a div when i select a

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.