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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:24:28+00:00 2026-05-13T19:24:28+00:00

I want to take div s and and this html in li . This

  • 0

I want to take “div” s and and this html in “li” .

This is my HTML code:

<ul class="NewContent">

    </ul>   
        <div class="test">
            <span>Text1</span>
        </div>

        <div class="test">
            <span>Text2</span>
        </div>

and jquery (not sure if it is ok started):

<script type="text/javascript">
        $(document).ready(function(){
            $('ul.NewContent').append("<li>"+ $('.test').html()+"</li>");
        });
    </script>

But the problem is, that I want to add each “div” content in new “li”

something like this:

output:

<ul class="NewContent">
            <li><span>Text1</span></li>
            <li><span>Text2</span></li>
        </ul> 

now is not good .. I need to add on array or something like this

Thanks !!

Sorry for My confusing description !

  • 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-13T19:24:28+00:00Added an answer on May 13, 2026 at 7:24 pm

    This should do it:

    $(function() {
        $('.test').each(function() {
            $('ul.NewContent').append('<li>'+$(this).html()+'</li>');
            $(this).remove();
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Take the following, schematic html-code: <div> <span id='1' cust-attr='' /> <span id='2' /> <span
This code displays a Jquery dialog with an html textbox that is shown after
I have a html code like this: <div id=container> <div id=header> </div> <div id=content>
I have a HTML snippet as follows, I want to take the 'article-form' div,
hi, i am not sharing code. the problem is in this code please take
I want to take an ExtJS element(div) retrieved from the DOM selector, and convert
Im want a div to take up 100% of the viewport for mobile devices.
I want to take backup or restore of my oracle database through .Net code.
I want to take HTML form data and handle the submited data(string for example)
I want to take the values if the variable I define are not equal

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.