Latest web development tutorials

etiqueta <botón> HTML

Ejemplos

El siguiente marcado de un botón de código:

<button type="button">点我!</button>

Trate »

Soporte para el navegador

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Todos los principales navegadores soportan <botón> etiqueta.


definiciones de código e instrucciones

<Botón> define un botón.

En el botón <> dentro del elemento, se puede colocar el contenido, como texto o imágenes. Esta es la diferencia entre el elemento <input> y el uso para crear el botón medio.

Consejo: Siempre <botón> especifica el atributo type.Los distintos navegadores utilizan diferentes valores por defecto para el atributo type <button>.


Notas y sugerencias

NOTA: Si utiliza el botón <> en un formulario HTML, diferentes navegadores pueden presentar diferentes valores de un botón.Utilice el <input> botón Crear en un formulario HTML.


Diferencias entre HTML 4.01 y HTML5

HTML5 nuevos atributos: enfoque automático, de forma, formAction, formenctype, formmethod, formnovalidate y formtarget.


propiedad

Nuevo: HTML5 nueva propiedad.

属性 描述
autofocus New autofocus 规定当页面加载时按钮应当自动地获得焦点。
disabled disabled 规定应该禁用该按钮。
form New form_id 规定按钮属于一个或多个表单。
formaction New URL 规定当提交表单时向何处发送表单数据。覆盖 form 元素的 action 属性。该属性与 type="submit" 配合使用。
formenctype New application/x-www-form-urlencoded
multipart/form-data
text/plain
规定在向服务器发送表单数据之前如何对其进行编码。覆盖 form 元素的 enctype 属性。该属性与 type="submit" 配合使用。
formmethod New get
post
规定用于发送表单数据的 HTTP 方法。覆盖 form 元素的 method 属性。该属性与 type="submit" 配合使用。
formnovalidate New formnovalidate 如果使用该属性,则提交表单时不进行验证。覆盖 form 元素的 novalidate 属性。该属性与 type="submit" 配合使用。
formtarget New _blank
_self
_parent
_top
framename
规定在何处打开 action URL。覆盖 form 元素的 target 属性。该属性与 type="submit" 配合使用。
name name 规定按钮的名称。
type button
reset
submit 
规定按钮的类型。
value text 规定按钮的初始值。可由脚本进行修改。


Propiedades globales

<Botón> etiqueta es compatible con HTML propiedades globales .


Propiedades del evento

<Botón> etiqueta es compatible con las propiedades de evento HTML .


Artículos relacionados

Manual de HTML DOM Referencia: los objetos Button