40
rated 0 times
[
41]
[
1]
/ answers: 1 / hits: 18590
/ 12 Years ago, thu, march 29, 2012, 12:00:00
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>
More From » jquery