欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

HTML 5 <button> 標(biāo)簽

定義和用法

<button> 標(biāo)簽定義按鈕。

您可以在 button 元素放置內(nèi)容,比如文本或圖像。這是該元素與通過(guò) input 元素創(chuàng)建的按鈕的不同之處。

請(qǐng)始終為按鈕規(guī)定 type 屬性。不同的瀏覽器根據(jù) type 屬性使用不同的默認(rèn)值。

實(shí)例

標(biāo)記一個(gè)按鈕:

<button type="button">Click Me!</button>

親自試一試

HTML 4.01 與 HTML 5 之間的差異

HTML 5 中的新屬性:autofocus, form, formaction, formenctype, formmethod, formnovalidate 以及 formtarget。

提示和注釋

注釋:如果在 HTML 表單中使用 button 元素,不同的瀏覽器會(huì)提交不同的按鈕值。請(qǐng)使用 input 元素在 HTML 表單中創(chuàng)建按鈕。

屬性

屬性 描述
autofocusNew autofocus 如果設(shè)置,則當(dāng)頁(yè)面加載后使按鈕獲得焦點(diǎn)。
disabled disabled 禁用按鈕。
formNew form_name 規(guī)定按鈕屬于哪個(gè)表單。
formactionNew url

規(guī)定當(dāng)提交表單時(shí)向何處提交表單數(shù)據(jù)。

覆蓋表單的 action 屬性。

formenctypeNew 見(jiàn)注釋

規(guī)定如何在表單數(shù)據(jù)發(fā)送到服務(wù)器之前如何進(jìn)行編碼。

覆蓋表單的 enctype 屬性。

formmethodNew
  • delete
  • get
  • post
  • put

規(guī)定如何發(fā)送表單數(shù)據(jù)。

覆蓋表單的 method 屬性。

formnovalidateNew formnovalidate

如果設(shè)置,指示是否在提交時(shí)驗(yàn)證表單。

覆蓋表單的 novalidate 屬性。

formtargetNew
  • _blank
  • _self
  • _parent
  • _top
  • framename

規(guī)定在何處打開 action 中的 URL。

覆蓋表單的 target 屬性。

name button_name 規(guī)定按鈕的名稱。
type
  • button
  • reset
  • submit
定義按鈕的類型。
value some_value 規(guī)定按鈕的初始值。可由腳本進(jìn)行修改。

注釋:formenctypeNew 屬性可能的值:

  • application/x-www-form-urlencoded
  • multipart/form-data
  • text/plain

標(biāo)準(zhǔn)屬性

<button> 標(biāo)簽支持 HTML 5 中的標(biāo)準(zhǔn)屬性

事件屬性

<button> 標(biāo)簽支持 HTML 5 中的事件屬性。