jQuery access parent but object is null?
<p>I want to get the parent of a selected option which is a td and then use insertAfter to insert another td after it but the reference is coming back null? Can someone tell me why?</p>

<p>Thanks</p>

<pre><code>JQ('.defieldselect').live('change',function(){
    var $option = JQ(this).find('option:selected');
    if($option.attr('rel')=='Date'){            
        var ddlID = $option.parent().parent().parent().find('.criteria-value').find('input').attr("id");
        var index = ddlID.split("_")[1];
        var select = CreateDateSelectList(index);
        $(select).insertAfter($option.parent);
    }        
});
</code></pre>

<p>HTML</p>

<pre><code>    &lt;tr&gt;

        &lt;td id="g1_c0_criteria_field" class="criteria-field"&gt;
            &lt;select class="defieldselect" name="g1_c0_criteria_field"&gt;

&lt;option rel="Text"&gt;Product ID 1&lt;/option&gt;
&lt;option rel="Date"&gt;Date Added&lt;/option&gt;

            &lt;/select&gt;
        &lt;/td&gt;
        &lt;td class="criteria-operator"&gt;
            &lt;select id="g1_c0_criteria_operator" name="g1_c0_criteria_operator"&gt;
                &lt;option value="="&gt;is equal to&lt;/option&gt;
                &lt;option value="!="&gt;is not equal to&lt;/option&gt;
                &lt;option value="&amp;gt;"&gt;is greater than&lt;/option&gt;
                &lt;option value="&amp;lt;"&gt;is less than&lt;/option&gt;
                &lt;option value="LIKE"&gt;contains&lt;/option&gt;
                &lt;option value="NOT LIKE"&gt;does not contain&lt;/option&gt;
                &lt;option value="LIKE"&gt;begins with&lt;/option&gt;
            &lt;/select&gt;
        &lt;/td&gt;


    &lt;/tr&gt;
</code></pre>
