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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:51:55+00:00 2026-05-26T14:51:55+00:00

I apologize if this one will sound too easy for most, so I’m totally

  • 0

I apologize if this one will sound too easy for most, so I’m totally shooting an answer here:

Mainly I would like to understand how you bind different JQuery functions to different elements

==========================================
I have a MENU that has 2 links items

   <a id="aLogin" href="???">Login</a>
   <a id="aRegister" href="???">Register</a>

I also have 2 DIVs each one that shows the right elements

<div id="dLogin" class="hide">
  ...elements to login
</div>

<div id="dRegister" class="hide">
  ...elements to register
</div>

I understand that i can change the class from JQuery from “hide” to “show”
but my question is: how can I specify the Login link to execute the right Jquery function (the one that changes the class of the DIV Login to “show”) ??

  • 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-26T14:51:56+00:00Added an answer on May 26, 2026 at 2:51 pm

    In the href you just give #

    <a id="aLogin" href="#">Login</a>
    <a id="aRegister" href="#">Register</a>
    

    Use the jQuery’s click event to bind onclick event to each link.
    And the toggleClass to toggle between the hide and show classes

    $("#aLogin").click(function(){
        $("#dLogin").toggleClass("hide").toggleClass("show");
        retun false;
    }
    
    $("#aRegister").click(function(){
        $("#dRegister").toggleClass("hide").toggleClass("show");
        retun false;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This might be one of those questions that are difficult to answer, but here
Python beginner here, so I apologize if this question has a simple answer. (I
Hopefully no one has asked this question - didn't see it, but I apologize
My apologies if this is an easy one. I have Googled it up the
I apologize if this is a duh question. It seems like the answer should
have Googled the cr*p out of this one so apologies if the answer is
I'm sure folks will get a good laugh out of this one, but for
I apologize if this question is something of the most simple, but I'm not
This feels like a super newb question, so apologizes in advance. How does one
Apologize if this particular problem has been answered already (a search didn't turn anything

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.