📅  最后修改于: 2023-12-03 15:15:38.866000             🧑  作者: Mango
<input type = "button">
The <input type = "button">
element is used in HTML to create a clickable button on a web page.
<input type = "button" [attribute=value]>
<input type="button" value="Click Me!" onclick="myFunction()" class="button-style" id="myButton">
This example creates a button with the text "Click Me!" which, when clicked, will execute the JavaScript function myFunction()
. The button has the CSS class "button-style" and has the unique id "myButton" assigned to it.
<input type = "button">
element is a self-closing tag, meaning it does not have a closing tag.value
attribute is not specified, the default value for the button will be displayed, which is typically "Submit".For more information, you can refer to the MDN web docs - <input>
element.
Markdown类型代码片段:`````html
<input type="button" value="Click Me!" onclick="myFunction()" class="button-style" id="myButton">