I want to create a JavaScript function that parses my HTML page, get the Table by it’s ID, and after that, add a class attribute to each <tr> as if the line is the 1st, I’ll add :
class=”line1″ to the <tr>
but if the line is the second, I’ll add class=”line2″ to the <tr>
How to do please
I want to create a JavaScript function that parses my HTML page, get the
Share
If I understand you corrrectly, you want to alternate the class names to get some kind of zebra style right?
See the HTML DOM Table Object.