liveBook · Manning

onClick

onClick is an event-handler property, attribute, or callback association that specifies behavior in response to a user-interface click event.

How 2 Manning books explain it

React Quickly, Second Edition

onClick is a React event-handler property that specifies a callback for click events on an element or component.

How it is used
Handles user clicks in interactive React interfaces by assigning callbacks to JSX elements or components.
How deep it goes
Defines JSX assignment, event objects, propagation, and default-action control, while deferring most implementation details.
Examples
Uses a button that opens an expandable menu and contrasts React handlers with window and menu pointer-down listeners.
What you can do after
Apply it via React to attach click callbacks, update component state, and control event behavior with the event object.

Read how React Quickly, Second Edition explains onClick →

Pro ASP.NET Core 7, Tenth Edition

The @onclick attribute is a Blazor event-handling directive attribute that binds a user-interface click event to a .NET method or expression.

How it is used
Uses button clicks in Blazor administration components to trigger application actions.
How deep it goes
Explains method and callback invocation through component examples, while deferring deeper Blazor treatment.
Examples
Shows order selection, data refresh, and product deletion in SportsStore administration components.
What you can do after
Apply Blazor’s @onclick directive to invoke component methods for order selection, refresh, or product deletion.

Read how Pro ASP.NET Core 7, Tenth Edition explains onClick →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.