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.
<body>
<div id="content"></div>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$("#content").append('<select id="sel" onchange="fly()"><option value="1">Choose Me</option></select>');
$("#sel").attr("onchange", "hello()");
alert($("#sel").attr("onchange"));
function hello() {
alert("Hello");
}
function fly() {
alert("Go to fly");
}
</script>
</body>