freezegravity
asked on
count number of child tags
Hello experts:
Is there an easy way to count the number of child tags an html tag has?
For example, I want to know the number of columns for this row in a table (in this case, it is three, but I want to write a for loop that goes through each of the tds in a table where I don't know the column amount):
<tr id="some_row">
<td>value 1</td>
<td>value 2</td>
<td align="center">value 3</td>
</tr>
Thanks in advance for your help
Is there an easy way to count the number of child tags an html tag has?
For example, I want to know the number of columns for this row in a table (in this case, it is three, but I want to write a for loop that goes through each of the tds in a table where I don't know the column amount):
<tr id="some_row">
<td>value 1</td>
<td>value 2</td>
<td align="center">value 3</td>
</tr>
Thanks in advance for your help
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks a bunch!