title: javascript to set attribute readonly on dropdown value change
body: <p>on selecting values from the drop down, if the selected  values equals to a certain value, i want the dropdown to change to readonly, how can i do that? </p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;select id="s_id"&gt;
     &lt;option value="volvo"&gt;Volvo&lt;/option&gt;
     &lt;option value="saab"&gt;Saab&lt;/option&gt;
     &lt;option value="opel"&gt;Opel&lt;/option&gt;
     &lt;option value="audi"&gt;Audi&lt;/option&gt;&lt;/select&gt;
  </code></pre>
  
  <p>Script:</p>
  
  <pre><code>$(document).ready(function () {
     $("#s_id").change(function () {
       var x = $(this).val();
       //alert("something's changed");
       alert($(this).val());
       if (x === opel) {
           alert("iff only.....");
           $(this).attr("readOnly", "true");
      }
     });
  });
  </code></pre>
  
  <p>Fiddle: <a href="http://jsfiddle.net/L4reds/xKQUd/2/">http://jsfiddle.net/L4reds/xKQUd/2/</a></p>