title: how to select a specific option when a condition exists
body: <p>I want to select the specific option in drop down list when a condition is existed.I set the Session in php and if the combo box has the value of <code>1</code> , it will be shown the option with value <code>1</code>. I mean if session is <code>1</code>, select the option with value of <code>1</code>, if session is <code>2</code>, select the option with vlaue of <code>2</code>, and so on... . I want to set automatically select(I see the changes) with session in <code>php</code>.
   sth like blewo:</p>
  
  <pre><code>&lt;select id="sel" &gt;
    &lt;option value='1'&gt;one&lt;/option&gt;
    &lt;option value='2'&gt;two&lt;/option&gt;
    &lt;option value='3'&gt;three&lt;/option&gt;
  &lt;/select&gt;
   &lt;?php $_SESSION['num']='1'; ?&gt;
  &lt;script&gt;
    //must be shown the option with value of `1`.
  &lt;script&gt;
  </code></pre>