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

  • Home
  • SEARCH
  • 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 9195417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:37:24+00:00 2026-06-17T21:37:24+00:00

i am making navigation bar using <ul> and <li> i first data like (html)

  • 0

i am making navigation bar using <ul> and <li>

i first data like (html)

  <ul id="menu_xml_txt">
     <li id="1"> Root Catalog </li>
 </ul>

when click on Root Catalog it will replace this all <li> it will like

<ul id="menu_xml_txt">
 <li id="2">Apparel</li> 
 <li id="3">Accessories</li>
</ul>

and so on. when you click it will changed and replaced by all new <li>

when you click on <li> it will added to a div=reg_navlist i am using .append of jquery function

then it will like

<ul id="reg_navlist">
 <li id="1">Root Catalog</li>  
 <li id="3">Accessories</li> 
 <li id="45">bla bla..</li> 
 <li id="80">bla bla..</li> 
 <li id="95">bla bla..</li> 
 <li id="115">bla bla..</li> 
 </ul>

i want to remove only those <li> element which is i have clicked & li and coming after it
for example if i have clicked on where <li id=45> then the id=45 and id= 80, id=95, and id=115 will be removed not the id=1 and id=3

i have tried this jQuery code

 j('#region_navlist li').live('click', function() {
    var cliked_id = j(this).attr('id');
    j('#region_nav li:not(:first)').remove();
});

but it is removing all the <li> not the first one

  • 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-17T21:37:25+00:00Added an answer on June 17, 2026 at 9:37 pm

    do:

    j('#region_navlist li').on('click', function() {
        j(this).nextAll().andSelf().remove();
    });
    

    See: andSelf() and nextAll()

    Note:- .live() is deprecated you use .on() if version 1.7
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I fix this navigation bar? I tried making it on my own
I am making a navigation bar and would like the link to change color
I've been experimenting with making a HTML/CSS navigation bar with chevron-shaped list items. I've
I subclassed my navigation bar, making the title view clickable. When clicked, it will
I'm making a theme for wordpress. My navigation bar has rounded corners like apple's
I'm making a navigation bar like Twitter, but I want that one div inside
I'm making a web application that uses hash tags for page navigation like this
I'm making a navigation bar that remains at the top of the page. When
I am making for my Graduation Project a low price Navigation device, using Android
I'm making a navigation bar for my website. The navigation bar is a picture,

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.