In IE7 Jquery Selector not working
<p>I have a simple html like -</p>

<pre><code>&lt;div id="mainDiv"&gt;
 &lt;form method="post"&gt;
   &lt;input type="hidden" id="txtId" value="123"&gt;
 &lt;/form&gt;
&lt;/div&gt;
</code></pre>

<p>I am using following selector for accessing hidden field -</p>

<pre><code>var txtVal = $('#mainDiv #txtID').val();
alert(txtVal);
</code></pre>

<p>which is working fine in FF and cheome but in IE7, alert is saying "undefined".</p>
