title: Using $("#select-id").prop("selectedIndex") In A Select Statement
body: <p>OK, so I've been made to understand that using this</p>
  
  <pre><code>$("#select-id").prop("selectedIndex")
  </code></pre>
  
  <p>in conjunction with this</p>
  
  <pre><code>$("#select-id").prop("selectedIndex", 1)
  </code></pre>
  
  <p>Would help obtain the results I'm looking for in getting certain elements passed back to a select statement, but I cannot find any examples of usage for this.  </p>
  
  <p>Lets say I have 6 elements in the select, and I have them being compared against something in another field. What would be the recommended way to set this up? I understand use a for loop, and then an if statement to iterate through the values, but I don't quite get how to use the aforementioned .prop statements. </p>
  
  <p>Any help would be appreciated.</p>
  
  <pre><code>function compareAmts($FIELDSwitchText, $FIELDSwitchPull)
  {
  var SwitchAdv = 0;
  temp = $("#FIELD_SwitchPull").val();
  var SwitchComm = parseInt(temp.replace(/\,/g,''));
  
  if($("#FIELD_SwitchText").val()!=""){
      SwitchAdv = parseInt($("#FIELD_SwitchText").val());
  </code></pre>
  
  <p>Basically this collects the information, I then need to use the 2 lines above in a For Loop to Get and Set the SelectedIndex, and thus the Select DropDown</p>