title: Change the selected value of a drop-down list with jQuery
body: <p>I have a drop-down list with known values. What I'm trying to do is set the drop down list to a particular value that I know exists using <strong>jQuery</strong>. 
  Using regular <strong>JavaScript</strong>, I would do something like:</p>
  
  <pre><code>ddl = document.getElementById("ID of element goes here");
  ddl.value = 2; // 2 being the value I want to set it too.
  </code></pre>
  
  <p>However, I need to do this with <strong>jQuery</strong>, because I'm using a <strong>CSS</strong> class for my selector (stupid <a href="http://en.wikipedia.org/wiki/ASP.NET" rel="noreferrer">ASP.NET</a> client ids...).</p>
  
  <p>Here are a few things I've tried:</p>
  
  <pre><code>$("._statusDDL").val(2); // Doesn't find 2 as a value.
  $("._statusDDL").children("option").val(2) // Also failed.
  </code></pre>
  
  <blockquote>
    <p>How can I do it with <strong>jQuery</strong>?</p>
  </blockquote>
  
  <hr>
  
  <p><strong>Update</strong></p>
  
  <p>So as it turns out, I had it right the first time with:</p>
  
  <pre><code>$("._statusDDL").val(2);
  </code></pre>
  
  <p>When I put an alert just above it works fine, but when I remove the alert and let it run at full speed, I get the error</p>
  
  <blockquote>
    <p>Could not set the selected property. Invalid Index</p>
  </blockquote>
  
  <p>I'm not sure if it's a bug with jQuery or <strong>Internet Explorer 6</strong> (I'm guessing Internet <strong>Explorer 6</strong>), but it's terribly annoying.</p>