//this.addClass('auth_choice'); // XXX for some reason, not all tr tags are HTMLElement's and thus, jQuery decide to not change the class... this.attr('class', 'auth_choice'); this.each(function() { var $i = $(this); $i.attr('data-provider', $i.find('input').attr('name')); });