2007年3月30日 星期五

HTML [input]標籤

input可選屬性

DTD indicates in which DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.
下表中的DTD列指明了被支持的DTD屬性。S=Strict(精確的),T=Transitional(傳統的),F=Frameset(框架)

屬性 描述 DTD
accept list_of_mime_types A comma-separated list of MIME types that indicates the MIME type of the file transfer.
以逗號分隔MIME類型列

Note: Only used with type="file"
注意:只能在type="file"的時候使用

STF
align left
right
top
texttop
middle
absmiddle
baseline
bottom
absbottom
Defines the alignment of text following the image.
定義圖片文字的對齊

Note: Only used with type="image"
注意:只能在type=''image"的時候使用

TF
alt text Defines an alternate text for the image.
定義針對圖片的替換文字

Note: Only used with type="image"
注意:只能在type=''image"的時候使用

STF
checked checked Indicates that the input element should be checked when it first loads.
當第一次加載的時候input元素是否為選中狀態

Note: Used with type="checkbox" and type="radio"
注意:只能在type="checkbox"以及type="radio"的時候使用

STF
disabled disabled Disables the input element when it first loads so that the user can not write text in it, or select it.
在第一次加載的時候讓input變為不可用狀態。

Note: Cannot be used with type="hidden"
注意:不要在type="hidden"的情況下使用

STF
maxlength number Defines the maximum number of characters allowed in a text field.
定義文字輸入框內所允許輸入的最大限度的字符數

Note: Only used with type="text"
注意:只有type="text"時才可使用

STF
name field_name Defines a unique name for the input element.
為input元素定義唯一的name

Note: This attribute is required with type="button", type="checkbox", type="file", type="hidden", type="image", type="password", type="text", and type="radio"
注意:對於ype="button", type="checkbox", type="file", type="hidden", type="image", type="password", type="text", 以及 type="radio"的元素來說這個屬性是必要的。

STF
readonly readonly Indicates that the value of this field cannot be modified.
可以讓其中的值變為只讀(不能做修改)

Note: Only used with type="text"
注意:只能type="text"的時候使用

STF
size number_of_char Defines the size of the input element.
定義input元素的大小

Note: Cannot be used with type="hidden"
注意:不能在type="hidden"的時候使用(無效果)

STF
src URL Defines the URL of the image to display.
定義要顯示圖片的URL

Note: Only used with type="image"
注意:只有type="image"的時候使用

STF
type button
checkbox
file
hidden
image
password
radio
reset
submit
text

Indicates the type of the input element. The default value is "text"
指明input元素的類型。默認值為"text"

Note: This is not a required attribute, but we think you should include it. If omitted, IE 5.5 will still display a text field, but Netscape 4.7 will not.
注意:這並不是必要的屬性。但還是應該加上它,因為每個瀏覽器的默認值不同

STF
value value For buttons, reset buttons and submit buttons: Defines the text on the button.
對於buttons, reset buttons 以及 submit buttons來說:定義按鈕的文字

For image buttons: Defines the symbolic result of the field passed to a script.
對於image按鈕來說:定義的值為傳送給腳本的結果

For checkboxes and radio buttons: Defines the result of the input element when clicked. The result is sent to the form's action URL.
對於checkboxes和radio buttons來說:定義的為選中後所代表的結果,該結果會發送動表單action所指定的URL上

For hidden, password, and text fields: Defines the default value of the element.
對於hidden,password以及text fields來說:
是為元素定義默認值

Note: Cannot be used with type="file"
注意:請不要在type="file"的時候使用

Note: This attribute is required with type="checkbox" and type="radio"
注意:對於type="checkbox"和type="radio"來說這是個必要屬性

STF

標準屬性

id, class, title, style, dir, lang, xml:lang

For a full description, go to Standard Attributes.
查看完整的屬性

事件屬性

tabindex, accesskey, onfocus, onblur, onselect, onchange, onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

For a full description, go to Event Attributes.
查看完整的屬性


出處

【下列文章您可能也有興趣】

沒有留言: