0
点赞
收藏
分享

微信扫一扫

第二次前端培训作业

惠特曼 2022-02-05 阅读 59

4表单

6.1from

from标签用于为用户输入创建HTML

表单能包含input元素,比如文本,字段,复选框,单选框,提交按钮等。

表单用于向服务器输入数据,from元素是块级元素,其前后会会产生折行

标签定义及使用说明
<form> 标签用于创建供用户输入的 HTML 表单。

<form> 元素包含一个或多个如下的表单元素:

<input>
<textarea>
<button>
<select>
<option>
<optgroup>
<fieldset>
<label>
4.2input

input标签用于搜集用户信息

根据不同的type属性值,输入字段拥有很多种形式比如文本,字段,复选框,单选框,提交按钮等

属性    值    描述
accept    audio/* video/* image/* MIME_type    规定通过文件上传来提交的文件的类型。 (只针对type="file")
align    left right top middle bottom    HTML5已废弃,不赞成使用。规定图像输入的对齐方式。 (只针对type="image")
alt    text    定义图像输入的替代文本。 (只针对type="image")
autocompleteNew    on off    autocomplete 属性规定 <input> 元素输入字段是否应该启用自动完成功能。
autofocusNew    autofocus    属性规定当页面加载时 <input> 元素应该自动获得焦点。
checked    checked    checked 属性规定在页面加载时应该被预先选定的 <input> 元素。 (只针对 type="checkbox" 或者 type="radio")
disabled    disabled    disabled 属性规定应该禁用的 <input> 元素。
formNew    form_id    form 属性规定 <input> 元素所属的一个或多个表单。
formactionNew    URL    属性规定当表单提交时处理输入控件的文件的 URL。(只针对 type="submit" 和 type="image")
formenctypeNew    application/x-www-form-urlencoded multipart/form-data text/plain    属性规定当表单数据提交到服务器时如何编码(只适合 type="submit" 和 type="image")。
formmethodNew    get post    定义发送表单数据到 action URL 的 HTTP 方法。 (只适合 type="submit" 和 type="image")
formnovalidateNew    formnovalidate    formnovalidate 属性覆盖 <form> 元素的 novalidate 属性。
formtargetNew    _blank _self _parent _top framename    规定表示提交表单后在哪里显示接收到响应的名称或关键词。(只适合 type="submit" 和 type="image")
heightNew    pixels    规定 <input>元素的高度。(只针对type="image")
listNew    datalist_id    属性引用 <datalist> 元素,其中包含 <input> 元素的预定义选项。
maxNew    number date    属性规定 <input> 元素的最大值。
maxlength    number    属性规定 <input> 元素中允许的最大字符数。
minNew    number date    属性规定 <input>元素的最小值。
multipleNew    multiple    属性规定允许用户输入到 <input> 元素的多个值。
name    text    name 属性规定 <input> 元素的名称。
patternNew    regexp    pattern 属性规定用于验证 <input> 元素的值的正则表达式。
placeholderNew    text    placeholder 属性规定可描述输入 <input> 字段预期值的简短的提示信息 。
readonly    readonly    readonly 属性规定输入字段是只读的。
requiredNew    required    属性规定必需在提交表单之前填写输入字段。
size    number    size 属性规定以字符数计的 <input> 元素的可见宽度。
src    URL    src 属性规定显示为提交按钮的图像的 URL。 (只针对 type="image")
stepNew    number    step 属性规定 <input> 元素的合法数字间隔。
type    button
checkbox
color
date
datetime
datetime-local
email
file
hidden
image
month
number
password
radio
range
reset
search
submit
tel
text
time
url
week    type 属性规定要显示的 <input> 元素的类
value    text    指定 <input> 元素 value 的值。
widthNew    pixels    width 属性规定 <input> 元素的宽度。 (只针对type="image")
————————————————

举报

相关推荐

网页前端第二次培训

第二次网页前端培训(HTML)

第二次网页前端培训笔记

第二次作业

HTML第二次培训

第二次java作业

0 条评论