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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:16:38+00:00 2026-06-12T23:16:38+00:00

I have the following code structure: <div></div> <ul> <li></li> <li></li> </ul> <div></div> <ul> <li></li>

  • 0

I have the following code structure:

<div></div>

<ul>
    <li></li>
    <li></li>
</ul>

<div></div>

<ul>
    <li></li>
    <li id="current"></li>
</ul>

Sorry I used HTML in my post and it hid DIV.

I am looking for a <DIV> immediately above the parent <UL>.

  • 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-12T23:16:39+00:00Added an answer on June 12, 2026 at 11:16 pm

    You could use either:

    $('#current').parent() // goes to the closest parent - which is the <ul>
                 .prev();  // now, starting at that <ul>
                           // we go to the previous html element which is <div>
    
    //Could also be done:
    $('#current').closest('ul')
                 .prev();  // or .prev('div') - there's a lot of options
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following HTML structure <div id=test-1-yay></div> ... bunch of code ... <div
I have the following HTML code / structure: <div id=container> <div id=div1>text</div> <div id=div2>more
I have the following html structure <div id=rn_answertext> <p>asdasdasdas</p> <p>asdasdasdas</p> <p>asdasdasdas</p> <h3>asdasdasdas</h3> <div id=test>Content
I have a jQuery slideshow code that works fine with the following HTML structure:
I have a following problem here: in my html structure I got some div's
I have the following HTML structure: <div><a href=link1>blah</a></div> <div><a href=link2>blah</a></div> <div><a href=link3.swf>blah</a></div> <div><a href=link4>blah</a></div>
I have the following html structure: <div> <button> <img src=img/a.png /> </button> <h2>Title</h2> </div>
Suppose I have the following HTML code: <div id=container style=width: 960px> <div id=help_panel style=width:
I have the following node structure in my HTML: <div id=widget1 class=dojoxFloatingPane dijitContentPane dojoxFloatingPaneFg
I have following html structure: <div id=123 class=test> <div class=testMessage>Foo</div> <div><div class=testDate>2010</div></div> <div id=127

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.