Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

button attributes in html

<!-- autofocus: button gets focus when page loads -->
<button type="button" autofocus>Click Me!</button>
<!-- disabled: specifies that a button should be disabled -->
<button type="button" disabled>Click Me!</button>
<!-- form: id of form the button belongs to -->
<form action="/action_page.php" method="get" id="form1">
<label for="fname">First name:</label>
<input type="text" id="fname" name="fname">
</form>
<button type="submit" form="form1" value="Submit">Submit</button>
<!-- type: button | reset | submit -->
<form action="/action_page.php" method="get">
  <label for="fname">First name:</label>
  <input type="text" id="fname" name="fname">
  <button type="submit" value="Submit">Submit</button>
  <button type="reset" value="Reset">Reset</button>
</form>
 
PREVIOUS NEXT
Tagged: #button #attributes #html
ADD COMMENT
Topic
Name
2+5 =