jQuery Select change event firing twice
Hmmm...nice one
jQuery code:
$('#my_dd').change(function(){
alert('hello') ;
})
Surprisingly on change the alert was getting fired twice.
Solution:
Nothing much, this was more or less my ignorance, put the block inside document ready and everything should be fine
Final code:
$(document).ready(function(){
$('#my_dd').change(function(){
alert('hello') ;
})
})
Hope this helps anyone.
Cheers
< select id="my_dd" > < ! -- options -- >< /select >
jQuery code:
$('#my_dd').change(function(){
alert('hello') ;
})
Surprisingly on change the alert was getting fired twice.
Solution:
Nothing much, this was more or less my ignorance, put the block inside document ready and everything should be fine
Final code:
$(document).ready(function(){
$('#my_dd').change(function(){
alert('hello') ;
})
})
Hope this helps anyone.
Cheers
Comments