I am little confused in binding onchange
to select
. I can see there are multiple ways of doing this.
html
<select id="ddl" onchange="test()"></select>
jquery
$(function(){
$("#ddl").change(function(){
return test();
});
});
or
$(function(){
$("#ddl").bind("change", function(){
return test();
});
});
Among these 3 methods
- Which one is considered as a standard practice?
- Is there any merits with any of these methods?