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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T10:01:04+00:00 2026-05-19T10:01:04+00:00

<ul> <li class=res></li> <li class=res></li> <li class=res selected></li> <li class=res></li> </ul> Using $(‘ul li.selected’).length

  • 0
<ul>
    <li class="res"></li>
    <li class="res"></li>
    <li class="res selected"></li>
    <li class="res"></li>
</ul>

Using $(‘ul li.selected’).length I can check total number of “selected elements” BUT I’d like to check the serial number of the “selected element” (in that case 3)
Can you help me do that.
Thanks

  • 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-19T10:01:05+00:00Added an answer on May 19, 2026 at 10:01 am

    What exactly do you mean by serial number?

    The content?

     alert (  $('ul li.selected').text() );
    

    The index?

     var listItem = $('ul li.selected');
     alert('Index: ' + $('ul li').index(listItem));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote a code sometime ago in which the object of ResultSet class res
I wrote the following program #include <iostream> template<typename C, typename Res, typename... Args> class
class EditAdminForm(forms.ModelForm): password = username.CharField(widget=forms.TextInput()) password = forms.CharField(widget=forms.PasswordInput()) password_confirm = forms.CharField(widget=forms.PasswordInput(), initial=???) You can
class Foo(){ public List<string> SomeCollection; } I need to implement an event which can
I have a Gallery with text items. I can change the selected item with
I'm learning c++ and using C++ Primer. Consider the following exercise 14.46: class Complex
I have a class called Res as follow @interface Res : NSObject { int
I know that files in the res directory are accessible from R.class while assets
I would like to program a time series class. The idea is that I
I want to mplement function that returns enum: class myClass{ private: res _res; public:

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.