Referencing a drop down menu in jQuery from ASP.NET
<p>This is a newbie question. I've been using jQuery for a day or so.</p>

<p>I simply want to capture each change in a drop down menu.</p>

<p>Here's my drop down menu and reference:</p>

<pre><code> &lt;script src="Scripts/insertRootCauseElements.js" type="text/javascript"&gt;&lt;/script&gt;
 &lt;asp:DropDownList ID="DropDownListRootCause" runat="server" &gt; &lt;/asp:DropDownList&gt;
</code></pre>

<p>Here's my handler:</p>

<pre><code>    $(document).ready(function () {

    //    var selectedValue = $('#DropDownListRootCause').selectedValue;
    //var selectedIndex = $('#DropDownListRootCause').selectedIndex;
    alert("HERE");
    $('#DropDownListRootCause').change(function () {
    alert("Changed " + $('#DropDownListRootCause').selectedIndex);
})
.change();
//    if ($('#DropDownListRootCause').change) {
//        alert("dd change " + selectedIndex);
//    }


})
</code></pre>

<p>I've tried a lot of variations but nothing is working for me. On debugging, it seems my jQuery doesn't know what "DropDownListRootCause" is. </p>

<p>I set AutoPostBack=true in my dd control which finds my jQuery but</p>

<pre><code>$('#DropDownListRootCause').change(function () {
    alert("Changed " + $('#DropDownListRootCause').selectedIndex);
})
</code></pre>

<p>Still evals to false.</p>

<p>I added DropDownListRootCause to 'Watch' when debugging which reveals 'DropDownListRootCause' is undefined'. I've tried double and single quotes but no luck.</p>

<p>It must be something simple but I can't see it. Can someone help?</p>
