title: HTML SELECT - Change selected option by VALUE using JavaScript
body: <p>There can be many options in a SELECT dropdown.</p>
  
  <pre><code>&lt;select id="sel"&gt;
      &lt;option value="car"&gt;1&lt;/option&gt;
      &lt;option value="bike"&gt;2&lt;/option&gt;
      &lt;option value="cycle"&gt;3&lt;/option&gt;
      ...
  &lt;/select&gt;
  </code></pre>
  
  <p>I'm creating a <em>Update Profile</em> page where a user's profile is retrieved from the database and a form is shown with those values. When it comes to <code>SELECT</code>dropdown, there are many options. So, its tedious test all values </p>
  
  <pre><code>if (value == '1')
      echo "&lt;option selected value='car'&gt;1&lt;/option&gt;";`
  </code></pre>
  
  <p>So, I want to have the corresponding option selected from its value. Like when I do something like <code>sel.value = 'bike'</code> using JavaScript the option <strong>2</strong> should be selected.</p>