<p>I need to get the data of an particular <code>&lt;td&gt;</code>, but I don't have any <code>id</code> or <code>name</code> for that particular <code>&lt;td&gt;</code>. How do you get the contents of that <code>&lt;td&gt;</code>?</p>

<p>For example:</p>

<pre><code>&lt;table&gt;
  &lt;tr&gt;&lt;td&gt;name&lt;/td&gt;&lt;td&gt;praveen&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;designation&lt;/td&gt;&lt;td&gt;software engineer&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>Is it possible to get the value "designation" from this table.. I need to extract the word "software engineer" using javascript.</p>

Something along the line of:
(not tested, just quick code to give an idea)
```
```
var tables = document.getElementById('TABLE'); // instead of document.all.tag
var rows;
var cells;
var maxCells = 1;
var designation;
if (tables) {
    for (var t=0; t<tables.length; t++) {
        rows = tables[t].all.tags('TR');
        if (tables[t].all.tags('TABLE').length == 0) {
            for (var r=0; r<rows.length; r++) {
                if (rows[r].innerText != '') {
                    cells = rows[r].all.tags('TD');
                    for (var c=0; c<cells.length; c++) {
                        if (cells[c].innerText == 'designation' && c<(cells.length-1)) {
                            designation = cells[c+1].innerText;
                        }
                    }
                }
            }
        }
    }
}
```
```
Since document.all is IE specific, you should rather user getElementById, with the following to
redefine that function for IE
:
```
```
if (/msie/i.test (navigator.userAgent)) //only override IE
{
    document.nativeGetElementById = document.getElementById;
    document.getElementById = function(id)
    {
        var elem = document.nativeGetElementById(id);
        if(elem)
        {
            //make sure that it is a valid match on id
            if(elem.attributes['id'].value == id)
            {
                return elem;
            }
            else
            {
                //otherwise find the correct element
                for(var i=1;i<document.all[id].length;i++)
                {
                    if(document.all[id][i].attributes['id'].value == id)
                    {
                        return document.all[id][i];
                    }
                }
            }
        }
        return null;
    };
}
```
```