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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:45:24+00:00 2026-06-02T01:45:24+00:00

I have the following list and would like to remove an element from it.

  • 0

I have the following list and would like to remove an element from it. In this particular instance I would like to remove the second element:

<a id="q1" rel="1" class="pagenum" href="#">2</a>

And here’s the code for the list:

        <div id="carousel">
        <ul class="overview">
          <li id="l1">
              <a id="q0" rel="0" class="pagenum" href="#">1</a>
              <a id="q1" rel="1" class="pagenum" href="#">2</a>
              <a id="q2" rel="2" class="pagenum" href="#">3</a>
              <a id="q3" rel="3" class="pagenum" href="#">4</a>
              <a id="q4" rel="4" class="pagenum" href="#">5</a>                
          </li>
         </ul>
        </div>

Thanks, in advance.

EDIT: I was hoping to use something along the lines of $.each:

$("carousel li").each(function(index){
   if(index == SOME_NUM){
       this.remove()
   }
 });

However this doesn’t seem to work.

ADDITIONAL EDIT:

Thanks and apologies to all those who answered. I did not phrase my question correctly. I did find the remove() function prior to posting here – it is well documented on google :). However, I am trying to loop through the elements of the “li” and then remove particular elements via a $.each loop.

Thanks for any and all additional replies.

  • 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-02T01:45:26+00:00Added an answer on June 2, 2026 at 1:45 am

    I think this should do what you want it to do.

    $counter = 0;
    $("#carousel li").each(function(){
        if($counter == SOME_NUM)
        {
            this.remove();
        }
        $counter++;
    });
    

    You’ll want to use jquery $variables here rather than javascript vars because javascript vars are function scoped, while the $variables are document scoped.

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

Sidebar

Related Questions

I have the following list of time zones that a user can choose from,
I have a class that stores all created references in a static list like
I have the following table format and would like to be able to add
I would like to do the following match company/client-list => 'companies#list' however, when I
Suppose I have the following dictionary and list: my_dictionary = {1:hello, 2:goodbye, 3:World, sand:box}
I have the following List<int> collection and I need to find the highest integer
I have the following list <ul> <li id=item1>Item 1</li> <li id=item2>Item 2</li> <li>Item 3</li>
I have the following list in Python: [[1, 2], [3, 4], [4, 6], [2,
I have the following list: <s:List id=list x=4 y=4 width=99% height=99% dataProvider={recordingsShown} itemRenderer=components.VideoItemRenderer useVirtualLayout=false
If we have the following list: list = ['UMM', 'Uma', ['Ulaster','Ulter']] If I need

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.