If this
really is a DOM Element (which is very probable using jQuery) it is as simple as just accessing the id
property of the element.
jQuery( '.anySelector' ).waypoint( function() {
console.log( this.id );
} );
If you really need to go the jQuery way (i.e. using the attr
method) you must turn this
into a jQuery object first:
jQuery( '.anySelector' ).waypoint( function() {
console.log( jQuery( this ).attr( 'id' ) );
} );