I'm adding an a css class which should colour row which is currently clicked, and I realized that it's working on every second row, on first row it wont work, on second row it will work an so on, I cant understand why is that happening?
I must say also that I'm using bootstrap table on my view, and table rows are dynamically created, but all of them should be the same.
Here is how my table looks after rows are added:
I noticed by default that rows are colour differently, that's how bootstrap table works I guess
And this is what is happened when I selected second row, it looks like this:
But when I'm clicking on a row 1 and on a row 3 nothing is happening even if I can see when I'm inspecting page that class is applied to row that I'm selecting.
My js:
$('#TableItems').on('click', 'tr', function (e) {
$(this).addClass('lol').siblings().removeClass('lol');
});
My css:
.lol
{
background: gray;
}


.lol { background: gray !important; }try this once!importantthat just leads to more issues further on. IMHO - CSS quickly ends up with every single line being marked as!important