input button

input button
HTML input button Element
Setting the HTML input element's type attribute to "button" will render a button with no specific behavior. Unlike the "submit" type of input this type will not automatically submit a web <form>. I personally use this button type input for engaging users in Javascript functionality on my pages and forms that process using Ajax instead of the traditional way.
HTML CODE EXAMPLE
<input type="button" value="Generic Button">
 
This example shows how to bind a Javascript function to a generic button to bring the little generic sucker to life.

HTML CODE EXAMPLE
<input type="button" value="Click Me" onclick="alert('Javascript!')">


Attributes for this element:

type - specify the type of input
Value: "button"

name - specify the input's name that your form parsing script will access
Possible Values: "short descriptive name"

value - specify the button's value
Possible Values: "a string"

disabled - specify that the input be disabled
Possible Values: "disabled"

global attributes - global core attributes
See: list of global attributes

New HTML5 attributes for this element:(applies 2014)

form - set a relationship between the input and a form
Possible Values: "a form's id attribute value"

autofocus - specify that the input receive focus when page is loaded
Possible Values: "autofocus"


Event handlers for this element:

global event handlers - global event handler attributesSee: list of global event handlers

0 Response to "input button"

Post a Comment