AdNow

loading...

Etiqueta button HTML

Etiqueta <button> HTML


Ejemplo

Un botón pulsable está marcado de la siguiente manera:
<button type="button">Click Me!</button>
Inténtalo tú mismo "

Definición y uso

La etiqueta <button> define un botón pulsable.
Dentro de un elemento <button> puede poner contenido, como texto o imágenes. Esta es la diferencia entre este elemento y los botones creados con el elemento <input>.
Consejo: Siempre especifique el atributo de tipo para un elemento <button>. Los diferentes navegadores utilizan diferentes tipos predeterminados para el elemento <button>.
Consejo: los botones a menudo están diseñados con CSS: Pruébelo »

Soporte del navegador

Element
<button>YesYesYesYesYes

Consejos y notas

Nota: Si usa el elemento <button> en un formulario HTML, los diferentes navegadores pueden enviar diferentes valores. Use <input> para crear botones en un formulario HTML.
Sugerencia: visite nuestro Tutorial de botones de CSS para descubrir cómo diseñar botones con CSS.

Diferencias entre HTML 4.01 y HTML5

HTML5 tiene los siguientes atributos nuevos: autofocus, form, formaction, formenctype, formmethod, formnovalidate y formtarget.

= Nuevo en HTML5.
AttributeValueDescription
autofocusautofocusSpecifies that a button should automatically get focus when the page loads
disableddisabledSpecifies that a button should be disabled
formform_idSpecifies one or more forms the button belongs to
formactionURLSpecifies where to send the form-data when a form is submitted. Only for type="submit"
formenctypeapplication/x-www-form-urlencoded
multipart/form-data
text/plain
Specifies how form-data should be encoded before sending it to a server. Only for type="submit"
formmethodget
post
Specifies how to send the form-data (which HTTP method to use). Only for type="submit"
formnovalidateformnovalidateSpecifies that the form-data should not be validated on submission. Only for type="submit"
formtarget_blank
_self
_parent
_top
framename
Specifies where to display the response after submitting the form. Only for type="submit"
namenameSpecifies a name for the button
typebutton
reset
submit
Specifies the type of button
valuetextSpecifies an initial value for the button

Atributos globales

La etiqueta <button> también admite los atributos globales en HTML .

Atributos del evento

La etiqueta <button> también admite los atributos de evento en HTML .

páginas relacionadas

Referencia de HTML DOM: Objeto de botón
CSS Tutorial: Styling Buttons

Configuración CSS predeterminada

Ninguna.

Formulario de contacto

Nombre

Correo electrónico *

Mensaje *

Entradas más populares de este blog

Listado pasaporte y cedulas SAIME 2018

Etiqueta HTML < abbr >

HTML < a > tag

Visitas a este blog