Descripción
Mediante el elemento button
podemos crear botones sobre los que podremos hacer click y lanzar acciones.
Es un elemento en línea que se posicionará detrás del elemento anterior. Podemos utilizar estilos CSS para modificar su estilo visual.
Sintaxis
<button>Texto Botón</button>
Atributos
- autofocus
- command
- commandfor
- disabled
- form
- formaction
- formenctype
- formmethod
- formnovalidate
- formtarget
- name
- popovertarget
- popovertargetaction
- type
- value
Atributos Globales
- accesskey
- anchor
- autocapitalize
- autocorrect
- autofocus
- class
- contenteditable
- data
- dir
- draggable
- enterkeyhint
- exportparts
- hidden
- id
- inert
- inputmode
- is
- itemid
- itemprop
- itemref
- itemscope
- itemtype
- lang
- nonce
- part
- popover
- role
- slot
- spellcheck
- style
- tabindex
- title
- translate
- virtualkeyboardpolicy
- writingsuggestions
Ejemplo
<form>
<label for="mensaje">Valor: </label>
<input id="mensaje" type="text" value="0"/>
<button id="inc">+1</button>
</form>
Artículos
Vídeos HTML
Disfruta también de nuestros artículos sobre HTML en formato vídeo. Aprovecha y suscribete a nuestro canal.