[jQuery] jQuery and OOP

[jQuery] jQuery and OOP

Do you really need an object at all? This (pun intended) would do the same
thing as all the code you listed:
$(function() {
var $btn = $('#btnCounter'), nr = 0;
$btn.click( function() {
$btn.attr( 'value', nr++ );
});
});
-Mike







    • Topic Participants

    • mike