If you'd like to contribute to the data, please check out, https://github.com/mdn/interactive-examples, https://github.com/mdn/browser-compat-data. onClick event is simply used to fire an action, execute code or call a function when the specified HTML element is clicked. Specifying an event parameter in an event method definition is optional and only necessary if the event type is used in the method. There's no need to manually call StateHasChanged. elements of type button are rendered as simple push buttons, which can be programmed to control custom functionality anywhere on a webpage as required when assigned an event handler function (typically for the click event). Sign in to enjoy the benefits of an MDN account. EventCallback is strongly typed and requires passing a T argument in InvokeAsync(T) that's assignable to TValue. Keyboard shortcuts, also known as access keys and keyboard equivalents, let the user trigger a button using a key or combination of keys on the keyboard. Razor components provide event handling features. For more information, see the following resources: It's often convenient to close over additional values, such as when iterating over a set of elements. The EventCallback is typed with MouseEventArgs, which is appropriate for an onclick event from a peripheral device: The ParentComponent sets the child's EventCallback (OnClickCallback) to its ShowMessage method. A comparison is done within each click handler to decide if the clicked radio is the same as the one stored in prev and if not then the currently clicked radio is stored there. To make buttons do anything, you have to write JavaScript code to do the work. The below example shows a very simple drawing app created using a