Ejemplo
Dos elementos de botón que actúan como un botón y un botón de reinicio (en forma) que presenten:
<form action="demo_form.asp" method="get">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<button type="submit" value="Submit">Submit</button>
<button type="reset" value="Reset">Reset</button>
</form>
Inténtalo tú mismo " Definición y Uso
El type atributo especifica el tipo de botón.
Consejo: Siempre especificar el type atributo para el <button> elemento.Los diferentes navegadores pueden utilizar diferentes tipos predeterminados para el <button> elemento.
Soporte para el navegador
Atributo | |||||
---|---|---|---|---|---|
type | Sí | Sí | Sí | Sí | Sí |
Diferencias entre HTML 4.01 y HTML5
NINGUNA.
Sintaxis
<button type="button|submit|reset">
Los valores de atributo
Valor | Descripción |
---|---|
button | El botón es un botón que se pulse |
submit | El botón es un botón de envío (somete form-data) |
reset | El botón es un botón de reinicio (restablece los form-data a sus valores iniciales) |