Alert if third td is occupied?
<p>I have a table like this (its a simplified version of my real table):</p>

<pre><code>&lt;table id="tabela"  width="100%" cellspacing="10px"&gt;
    &lt;tr&gt;
        &lt;td&gt;2:00:00&lt;/td&gt;
        &lt;td&gt;3:00:00&lt;/td&gt;
        &lt;td class='free'&gt;
            &lt;input type='radio' name='appointment'/&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;4:00:00&lt;/td&gt;
        &lt;td&gt;5:00:00&lt;/td&gt;
        &lt;td class='busy'&gt;Occupied&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;6:00:00&lt;/td&gt;
        &lt;td&gt;7:00:00&lt;/td&gt;
        &lt;td class='free'&gt;
            &lt;input type='radio' name='appointment'/&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>Now I want that when the radio button is selected and if the td below is set to occupied (its not really below, its the third td of the next tr from the current td if I explained that correctly) to simply display the alert message but I cant get it to work.</p>

<p>I tried something like this:</p>

<pre><code>$("input[name='appointment']").change(function()
{
    var thisTr = $("#tabela input[name=appointment]:checked")
        .closest('tr')
        .next('tr');

    var thirdTDText = thisTr.children().eq(2).text();
    if(thirdTDText=='Occupied')
    {
        alert('That place is occupied!');
    }
});
</code></pre>
