title: How Change calling function of onChange event using jQuery
body: <p>I have this code which can display drop down in div tag of html. In this I have set one function "hello()" to that drop down through jquery but the problem is that its not calling that function.</p>
  
  <pre><code>&lt;body&gt;
  &lt;div id="content"&gt;&lt;/div&gt;
  &lt;script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  
      $("#content").append('&lt;select id="sel" onchange="fly()"&gt;&lt;option value="1"&gt;Choose Me&lt;/option&gt;&lt;/select&gt;');
      $("#sel").attr("onchange", "hello()");
      alert($("#sel").attr("onchange"));
  
      function hello() {
          alert("Hello");
      }
  
      function fly() {
          alert("Go to fly");
      }
  &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>