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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:37:57+00:00 2026-06-06T06:37:57+00:00

Code required to append list (anotherList) to item (id -= l1) of second list

  • 0

Code required to append list (anotherList) to item (id -= l1) of second list (id= myList-toggle) but it should remove it after another click. But the remove is not working as expected. Some help in this regard expected.

 $('a#myList-toggle').click(function () {

                list.slice(0, counter()).slideToggle();

                 return false;

            });

            $('a#l1').click(function () {


                $('#l1').append($('#anotherList'));
               function () {
                   $('#al1').remove();
                };
                $('#anotherList').show();
                return false;

            });

        });



    </script>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
        <div>
        <a href="#" id="myList-toggle">GO Now!!!!!!!</a></div>
    <ul id="myList" style="margin-bottom: 0px">
        <li><a href="#" id="l1">item1</a></li>
        <li><a href="#" id="l4">item2</a></li>
        <li><a href="#" id="l5">item3</a></li>
        <li><a href="#" id="l6">item4</a></li>
        <li><a href="#" id="A1">item5</a></li>
        <li><a href="#" id="A2">item6</a></li>
        <li><a href="#" id="A3">item7</a></li>
        <li><a href="#" id="A4">item8</a></li>
    </ul>
    <ul id="anotherList">
        <li class="al1">Item</li>
        <li class="al1">Item</li>
        <li class="al1">Item</li>
        <li class="al1">Item</li>
    </ul>
</asp:Content>

Kindly tell if there is any other simple way to append and remove the list.

  • 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-06T06:37:59+00:00Added an answer on June 6, 2026 at 6:37 am

    Try changing $('#al1').remove(); to $('.al1').remove();

    Also, whats with the function() { before remove?

    I think its not necessary.

    EDIT:

    try this link: http://jsfiddle.net/9dVXg/

    I think that’s what you want to happen.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm after a definitive reference to what ASP.NET code is required to disabled browsers
The code below will validate required fields within currently visible fieldsets, but only if
What is the minimum code required to read a file and assign its contents
What is the code required to redirect the browser to a new page with
What's the minimum boilerplate code required to setup an OpenGL view (with the necessary
I am writing the following code to find out the required strings are present
Have a look at the following code you are not required to read the
source code ... Thing is, if i specify required metadata using fluent modelmetadata provider
here is post my code:this is no the entire code but enough to explain
I'm not usually one to just post code and say help, but I feel

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.