Here is an HTML/jquery code from w3s website.
If you try it at: Try It W3S
You will see the problem. odd rows have different opacity than even rows, this is ok,
but I want the text color(or brightness) to remain the same. How to do it?
I have tried it by setting: $("tr td").css("opacity","1.0");
but it didn't help.
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("tr").css("background-color", "yellow").css("opacity","1.0");
$("tr:odd").css("opacity","0.5");
$("tr td").css("opacity","1.0");
});
</script>
</head>
<body>
<h1>Welcome to My Web Page</h1>
<table border="1">
<tr>
<th>Company</th>
<th>Country</th>
</tr>
<tr>
<td>Alfreds Futterkiste</td>
<td>Germany</td>
</tr>
<tr>
<td>Berglunds snabbkцp</td>
<td>Sweden</td>
</tr>
<tr>
<td>Centro comercial Moctezuma</td>
<td>Mexico</td>
</tr>
<tr>
<td>Ernst Handel</td>
<td>Austria</td>
</tr>
<tr>
<td>Island Trading</td>
<td>UK</td>
</tr>
</table>
</body>
</html>