HTMl input

一个简单的 HTML 表单,包含两个文本输入框和一个提交按钮:
<form action="form_action.asp" method="get"> First name: <input type="text" name="fname" /> Last name: <input type="text" name="lname" /> <input type="submit" value="Submit" /></form>

属性

描述

DTD

accept

mime_type

规定通过文件上传来提交的文件的类型。

STF

align

left right top middle bottom

不赞成使用。规定图像输入的对齐方式。

TF

alt

text

定义图像输入的替代文本。

STF

checked

checked

规定此 input 元素首次加载时应当被选中。

STF

disabled

disabled

当 input 元素加载时禁用此元素。

STF

maxlength

number

规定输入字段中的字符的最大长度。

STF

name

field_name

定义 input 元素的名称。

STF

readonly

readonly

规定输入字段为只读。

STF

size

number_of_char

定义输入字段的宽度。

STF

src

URL

定义以提交按钮形式显示的图像的 URL。

STF

type

button

规定 input 元素的类型。

STF

value

value

规定 input 元素的值。

STF

属性

标准属性:id, class, title, style, dir, lang, xml:lang

事件属性:tabindex, accesskey, onfocus, onblur, onselect, onchange, onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

猜你喜欢

转载自blog.csdn.net/weixin_42666837/article/details/86666603