Примеры для jQuery event.delegateTarget


When a button in any box class is clicked, change the box's background color to red.

1
2
3
$( ".box" ).on( "click", "button", function( event ) {
$( event.delegateTarget ).css( "background-color", "red" );
});