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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:31:37+00:00 2026-05-16T16:31:37+00:00

I have two a tags and I want to create two separate click functions

  • 0

I have two a tags and I want to create two separate click functions because they behave different.

<div class="select-big">
    <div class="select-holder">
        <div class="button">
            <a href="#" class="trigger right"></a>
            <div class="cl">&nbsp;</div>
        </div>
        <div class="dropdown">
            <ul>
                <li><a href="#" class="icon-s icon-s2">Restaurant</a></li>
                <li><a class="icon-s icon-s1" href="#">Grocery</a></li>
                <li><a href="#" class="icon-s icon-s2">Pizza Delivery</a></li>
            </ul>
            <div class="cl">&nbsp;</div>
        </div>
    </div>

    <div class="select-holder select-holder2">
        <div class="button">
            <div id="one1" class="left number_changer"></div>
            <p id="count_of_stations" class="text left">Number Of Stations</p>
            <a href="#" class="trigger right"></a>
            <div class="cl">&nbsp;</div>
        </div>
        <div class="dropdown">​

currently i have this that selects both

$('.select-big ul li a').click(function () {
  • 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-16T16:31:38+00:00Added an answer on May 16, 2026 at 4:31 pm

    Give them unique IDs

    <li><a id="someID" href="#" class="icon-s icon-s2">Restaurant</a></li>  
    <li><a id="someOtherID" class="icon-s icon-s1" href="#">Grocery</a></li>
    <li><a id="someDifferentID" href="#" class="icon-s icon-s2">Pizza Delivery</a></li>
    

    jQuery

    $('#someID').click(function() {
        //  do something
    });
    
    $('#someotherID').click(function() {
        //  do something else
    });
    

    or select them by index:

    $('.select-big ul li a:eq(0)').click(function() {
        //  do something
    });
    
    $('.select-big ul li a:eq(1)').click(function() {
        //  do something else
    });
    

    or traverse from one to the next (if they are adjascent).

    $('.select-big ul li a:eq(0)').click(function() {
        //  do something
    })
      .next().click(function() {
        //  do something else
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create two div tags such that,they should be empty.I wanted to
I have two span tags inside two divs inside a master div <div> <div>
I have three div tags, a wrapper and two side by side within the
I have two tables: codes_tags and popular_tags. codes_tags CREATE TABLE `codes_tags` ( `code_id` int(11)
I have two SVN repostitories: Project A trunk tags branches Project B trunk tags
Let's say, I have two tables, entities and tags. Relation between them is expressed
I have a HTML fragment which contains two anchor tags in various parts of
I have two separate tables TVs and Receivers that I am using the FOR
I have two xml files which have the same data but different names for
Basically, what I'm trying to create is a page of div tags, each has

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.