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

The Archive Base Latest Questions

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

I am having the following structure on a website I am building: <tr> <td

  • 0

I am having the following structure on a website I am building:

<tr>

        <td class="header link"><a href="x" >X</a></td>
        <td class="header link"><a href="y" >Y</a></td>
        <td class="header link"><a href="z" >Z</a></td>
        <td class="header link"><a href="w" >W</td>

</tr>

All cells have the same background color initially.

What I would like to accomplish is the following:

When any of the links is clicked, the background color of the cell containing the link changes to new color and stays changed, until another link is selected.

When the other link is selected, the color of the firstly selected link changes back to the original color, while the cell of the newly selected link changes to new color.

Currently what I have in place is working hover function:

$(document).ready(function()
 {    $(function(){ $('.header').hover(function() {$(this).css('background-color', '#EBA521');},         
 function() { $(this).css('background-color', '#6F0000'); });  
 });
 }); 

How do I accomplish the above?

  • 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-23T12:42:28+00:00Added an answer on May 23, 2026 at 12:42 pm

    Try this:

    $(document).ready(function() {
            $('.header.link a').click(function() {
                    $('.header.link a').css('background-color', '#6F0000');
                    $(this).css('background-color', '#EBA521');
                    $(this).data("bgColor", "#EBA521")
                    return false;
            });
    });
    
    $(document).ready(function() {
            $(function() {
                    $('.header.link a').hover(function() {
                            $(this).data("bgColor", $(this).css('background-color'));
                            $(this).css('background-color', '#EBA521');
                    }, function() {
                            $(this).css('background-color', $(this).data("bgColor"));
                    });
            });
    });
    

    Working example: http://jsfiddle.net/Hbgz3/2/

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

Sidebar

Related Questions

I have DB2 table having following structure CREATE TABLE DUMMY ( ID CHARACTER(10) NOT
Hi currently I have a nested XMl , having the following Structure : <?xml
I have two tables Product having following structure: ProductID,ProductName, IsSaleTypeA, IsSaleTypeB, IsSaleTypeC 1, AAA,
The xml file is having the following structure <?xml version=1.0 encoding=utf-8?> <?xml-stylesheet type=text/xsl href=TestFile.xsl?>
I have a MySql table having the following structure: ontology_term pathway_id pathway_name I want
I have created a table in MSSQL having following structure - **Table Name -
I'm having the following structure of code in the service class. The problem is
Having the following simple class structure: class A { } class B extends A
I have an xml having the following structure: <metadata style=basic> <zonelist> <zone name=z0 type=poster
Having the following structure: <div id=block1> <ul class=category> <li>Comedy</li> </ul> </div> <div id=block2> <ul

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.