Sono poco confuso nel binding onchange
a select
. Vedo che ci sono molti modi per farlo.Binding onchange to dropdown
html
<select id="ddl" onchange="test()"></select>
jquery
$(function(){
$("#ddl").change(function(){
return test();
});
});
o
$(function(){
$("#ddl").bind("change", function(){
return test();
});
});
Tra questi 3 metodi
0.123.- Quale è considerata una pratica standard?
- C'è qualche merito con uno di questi metodi?
http: // stackoverflow.com/questions/937039/what-is-the-difference-between-the-bind-and-live-methods-in-jquery help you .. – sasi