It’s hard to explain, so I created an example:
My idea is to change the color of each column when the respective input is in action…
If anyone has a better idea to do this – please let me know!
When I focus the input, I need the current class of the column.
- first column input, get the class of the RED column
- and the second one, get the class of the BLUE column
- and so go’s on…
Because if I get the class, then I can manipulate anything with this class.
the code is here:
$(".inputTest").focusin(function(){
var class = $(this).closest('.tableList')
.children().children().children('.auxClass')
.attr('class')
.split(' ')[0];
alert(class);
});
This is the main code, I try alot of stuffs to get, but nothing.
Thanks
First I’d add an outer table to split the page in a left and a right hand side. That way, the inputs below the red border and the inputs below the blue border each have their own table.
Then you can search for the first
tdbelow the closest table:Click for working jsfiddle example.