Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 jQuery 的新手,我对以下问题感到困惑: 我应该通过某种方式在元素上onclick或元素上使用 jQuery :?onchange$(selector).somemethod(function(){....});
onclick
onchange
$(selector).somemethod(function(){....});
当然可以使用它,但这不是必需的。
$(selector).on('click', function() { } ); $(selector).on('change', function() { } );