Both
This attribute is also available on and
onclick 事件会在对象被点击时发生。 请注意, onclick 与 onmousedown 不同。单击事件是在同一元素上发生了鼠标按下事件之后又发生了鼠标放开事件时才发生的。 语法 onclick="SomeJavaScriptCode" Using submit buttons buttons are used to submit forms. The onClick event is the most frequently used event type, which occurs when a user clicks the left button of the mouse. While the button-text of an can be specified, you The "onclick" attribute is an event attribute that is supported by all browsers. You can put your validation, warning etc., against this event type. If it's an HTML button, you'd need to use ClientScript.RegisterStartupScript() to register a simple document.getElementById() on the button and use .click() to fire the click event.
You can add inline onclick event to HTML button tag, or input tag. As an alternative approach to what you require, you could use a data-attribute And use jQuery to handle which ID you need: 要素には既定の動作がありません (親戚である や は、それぞれフォームの送信とリセットに使用されます)。ボタンに何かをさせる場合は、処理を行うための JavaScript コードを書く必要があります。 HTML ID's should be unique. This page shows how to make HTML button links with onclick and href using the