Changing color of table column text when checkbox is checked?

Here's a jsfiddle example that turns the sibling td elements red when a checkbox is checked and turns them white when it's unchecked.

Here's a jsfiddle example that turns the sibling elements red when a checkbox is checked and turns them white when it's unchecked. With this basic HTML, Cell 2Cell 3 Cell 2Cell 3 Cell 2Cell 3 And this Javascript. (function($) { $(document).

Ready( function() { $('inputtype=checkbox'). Click( function(e) { var bgColor = $(this). Attr('checked') == 'checked'?'#f00' : '#fff'; $(this).parent().

Siblings('td'). Css('background', bgColor); }); }); })(jQuery).

He asked for the columns to change colors, not the rows. – mblase75 Aug 30 at 13:17 I assumed he meant the columns following the checkbox that was checked. Maybe he can clarify.

– Mark Biek Aug 30 at 13:19 Yep, I think you're right. I need to stop reading the questions here so quickly. – mblase75 Aug 30 at 13:22 No worries, happens to everyone :) – Mark Biek Aug 30 at 13:23 Right - mblase75 is correct, that's not quite what I'm looking for.

What I want is an arbitrary event (e.g. Some other control elsewhere on the page, document load, whatever) that will identify all of the checked rows and turn the text fields inside the other TD elements a different color. I tried using something along what you showed, but it didn't work yet (note: In this example I'm just using your css command and not actually changing the text color): $(input:checked).parent. Siblings('td').

Css('background',bgColor); – geoffjentry Aug 30 at 20:51.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions