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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:52:27+00:00 2026-05-28T06:52:27+00:00

I have the following html code: <ul> <li id=a1>content</li> <li id=a2>content</li> <li id=a3>content</li> <li

  • 0

I have the following html code:

<ul>
 <li id="a1">content</li>
 <li id="a2">content</li>
 <li id="a3">content</li>
 <li id="a4">content</li>
 <li id="a5">content</li>
 <li id="a6">content</li>
 <li id="a7">content</li>
</ul>

I want to use jquery to wrap these li tags into one div, same as:

<ul>
 <div id="list1">
  <li id="a1">content</li>
  <li id="a2">content</li>
  <li id="a3">content</li>
  <li id="a4">content</li>
  <li id="a5">content</li>
 </div>
 <div id="list2">
  <li id="a6">content</li>
  <li id="a7">content</li>
 </div>
</ul>

Any ideas how to do this?

Thank you!

EDIT: sorry for the confusion, to clarify my question: I have a series of li tags in one ul, i want to wrap some of them into one div (for example, wrap a1 to a5 in one div, a6 to a7 in one div). What i know for sure is that the li tags that I want to wrap have consecutive numbers as their ids.

EDIT2: I realized that it’s not valid to have divs inside a ul. The reason I’m asking this question is that I want to use jquery ui tabs to break the ul into two tabs, one having li a1 to a5 in it, a6 and a7 in the other tab. I cannot modify the html code so I wanted to know how to do this using jquery

  • 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-28T06:52:28+00:00Added an answer on May 28, 2026 at 6:52 am

    According to your comment, you want to split these 7 tabs into two tabs, each with sub tabs. You said you’re using jQuery UI tabs.

    jQuery UI tabs uses the following layout:

    <div id="tabs">
       <!-- These are the tabs -->
       <ul>
         <li><a href="#tab-A">Tab A</a></li>
         <li><a href="#tab-B">Tab B</a></li>
       </ul>
       <!-- This is your tab content -->
       <div id="tab-A">
         This is tab A
       </div>
       <div id="tab-B">
         This is tab B
       </div>
    </div>
    

    Running $('#tabs').tabs() will convert this into a two-tabbed layout. You just need to convert your HTML to look like this, and then it’ll work. And then inside each tab, just have another UL/div setup to add inner-tabs.

    Here is how you can do what you want: http://jsfiddle.net/cCjbC/1/

    It makes 2 outer tabs, then takes your ul, splits it and then adds those as inner tabs.

    • 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 code (in the given order) <div id=content>...</div> <div id=footer>...</div>
I have the following html and I want to use jQuery to toggle the
I have the following html code. <html> <body> <div style=max-width:1600px; min-width:900px; > <table> </table>
I have the following HTML code based on a tab menu format, i.e: <div
I have the following html code: <table> <tr> <td> <div id=fixmywidth style=position:relative; height:30px;> <div
I have the following html code <!DOCTYPE html> <html lang=en> <head> <meta name=viewport content=width=device-width;
i have the following code and i want to use NSMutable arrays instead of
Hi have the following content within an html page that stretches multiple lines <div
I have the following sample HTML code: http://pastebin.com/Mya6tPc6 And here is the jQuery code
following is my code html: <div id=content> <div id=A> A </div> <div id=B> B

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.