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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:25:22+00:00 2026-06-11T11:25:22+00:00

Here’s the nice and interesting problem I’m trying to figure out: I have a

  • 0

Here’s the nice and interesting problem I’m trying to figure out:

I have a table, containing 3 columns, and 8 rows. Table is generated via PHP, dynamically. Each td has a button in it with id 1,2 or 3, marking columns. Each button has 3 states/styles – Normal, clicked and hover (all different styles, 9 styles total).

So far I have managed to give each separated cell normal and hover style, via css, and I’ve created a jquery script to change class of clicked cell to its clicked style. Problem is, when I set cell style within one row, I want the two remaining cells in that row to be back to normal style:

left-normal middle-clicked right-normal
left-clicked middle-normal right-normal
left-normal middle-normal right-clicked
…

But only in THAT row.

This is my code so far:

function chooseItem(){

var left = $('#table td button#1');
    var middle = $('#table td button#2');
var right = $('#table td button#3');

        left.click(function () {
            $(this).removeClass('LeftNormal');
            $(this).addClass('LeftClicked');        
        })  

        right.click(function () {
            $(this).removeClass('RightNormal');
            $(this).addClass('RightClicked');         
        })  

         midle.click(function () {
            $(this).removeClass('MidleNormal');
            $(this).addClass('MidleClicked');           
        })
};

I have red a lot of related questions here, but no one had a similar problem. Thank you in advance!

  • 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-06-11T11:25:23+00:00Added an answer on June 11, 2026 at 11:25 am

    Do you want something like this ?

       var $table = $('table');
       $table.find('button').click(function() {
         $(this).addClass('selected').parent().siblings().find('button').removeClass('selected');
       });​
    

    Click to see in action : http://jsfiddle.net/8qLpm/

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

Sidebar

Related Questions

Here is the problem that I am trying to solve. I have two folders
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Here is my problem : I have a post controller with the action create.
Here's a problem I ran into recently. I have attributes strings of the form
Here's an interesting problem. On a recently installed Server 2008 64bit I opened IE
Here is what I am trying to achieve in PHP: I have this string:
Here is my problem.. I have the option to create(add) two new input fields,
Here are the tables I have: Table A which has entries with item and
Here's the code I have. It works. The only problem is that the first
Here is the code in a function I'm trying to revise. This example works

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.