title: How to edit 'onchange' attribute in a 'select' tag? (using jquery)
body: <p>I'm trying to edit the 'onchange' event of an existent 'select' element.</p>
  
  <p>For example purposes I have the following code: </p>
  
  <pre><code>&lt;select id="sel_id" onchange="javascript:foo();" &gt;
  </code></pre>
  
  <p>and whenever I try to change its 'onchange' attribute I was using the following:    </p>
  
  <pre><code>$("#sel_id").attr("onchange", "foo_2()");
  </code></pre>
  
  <p>FYI, this code which should be fine doesn't work, the 'onchange' attribute remains unchanged. So how should you edit it?</p>
  
  <p><strong>AMMENDMENT:</strong></p>
  
  <p>You can remove the attribute and then bind a different function like:  </p>
  
  <pre><code>$("#sel_id").removeAttr("onchange").bind("change", function(){ foo_2(); });   
  </code></pre>
  
  <p>but the issue remains, is it possible to change the 'onchange' attribute without removing it in the first place?</p>