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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:11:42+00:00 2026-05-23T19:11:42+00:00

<div class=nav-top> <ul> <li class=tab1><a href=/>test</a></li> <li class=tab2><a href=#>test</a></li> <li class=tab3><a href=#>test</a></li> <li class=navahead><a

  • 0
<div class="nav-top">
<ul>
  <li class="tab1"><a href="/">test</a></li>
  <li class="tab2"><a href="#">test</a></li>
  <li class="tab3"><a href="#">test</a></li>
  <li class="navahead"><a href="#">test</a></li>
  <li class="navahead"><a href="#">test</a></li>
<li class="new"><a href="#">test</a></li>
</ul>
</div>

i want to only add onmouse over event to the first three li(tab1,tab2,tab3). how to write the if condition.

  • 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-23T19:11:44+00:00Added an answer on May 23, 2026 at 7:11 pm

    You don’t need an if – you can use the jQuery :lt() selector

    $('ul li:lt(3)').mouseenter(function(){});
    

    Note that the index is zero-based, so the first three are 0, 1 and 2

    http://api.jquery.com/lt-selector/

    Update July 2020:

    As of jQuery 3.4, the :lt pseudo-class is deprecated. Remove it from your selectors and filter the results later using .slice(). For example, :lt(3) can be replaced with a call to .slice(0,3)

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

Sidebar

Related Questions

<div class=nav-top> <ul> <li class=test tab1><a href=/>test</a></li> <li class=tes tab2><a href=#>test</a></li> <li class=tes tab3><a
I have a menu set up this way: <div id='top-navigation'> <ul> <li><a class='top-nav-button-unclicked' href='#'>SUBJECT</a></li>
I want to center the text link in the div class .nav-tab I add
Example HTML (for the sake of clarity): <nav> <ul> <li class=top-navbar-channels> <a href=#></a> <div
I have the following markup: <div class=nav-font nav-item-3> <a href=/arc/place class=top_nav>favorite places</a> </div> and
<div id=action-nav> <ul> <li><a href=# class=selected>selected</a></li> <li><a href=#>selected</a></li> </ul> </div> and the styles: #action-nav
I want to scale the picture to fit the main div class http://jsfiddle.net/EyW99/ Sorry,
for example I have the following: I want to go through each div class
http://christianselig.com/wp I have a margin-top: 50px set to the .greeting class div, which is
I want a div to appear at the top when user scroll down pass

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.