<p>How do you calculate the number of <code>&lt;td&gt;</code> elements in a particular <code>&lt;tr&gt;</code>?</p>

<p>I didn't specify id or name to access directly, we have to use the <code>document.getElementsByTagName</code> concept.</p>

You can use something like the following:
```
```
var rowIndex = 0; // rowindex, in this case the first row of your table
var table = document.getElementById('mytable'); // table to perform search on
var row = table.getElementsByTagName('tr')[rowIndex];
var cells = row.getElementsByTagName('td');
var cellCount = cells.length;
alert(cellCount); // will return the number of cells in the row
```
```