Calling JavaScript Function on Demand Causing Strange Results
<p>I have a dropdownlist which is declared as follows: </p>

<pre><code>&lt;select onchange="reloadValues(this,event);"&gt;
... options here 
&lt;/select&gt;   
</code></pre>

<p>When the user change the selection reloadValues is invoked and everything works perfectly. Now, I want to add the reloadValues when the user adds a new row which contains the dropdownlist so I did the following: </p>

<pre><code>reloadValues(rowToBeAdded.find("select")[0]);
</code></pre>

<p>The reloadValues function is shown below: </p>

<pre><code> function reloadValues(obj, event) {
    {
            var ele = obj.parentElement.parentElement;
            var select2 = ele.cells[2].childNodes[1]; // ele.cells is empty when invoking // the reloadValues on demand through another method. 
    }
</code></pre>

<p>Any ideas! </p>

<pre><code>obj.parentElement.parentElement is a TR element
</code></pre>
