HTML标签

来源:互联网 发布:小天才软件下载 编辑:程序博客网 时间:2024/04/30 23:56

1.fieldset

<fieldset>   <legend>health information</legend>    height: <input type="text" />    weight: <input type="text" /></fieldset>

<legend> 标签为 fieldset 元素定义标题。
fieldset 元素可将表单内的相关元素分组。

2.tabindex
tabindex 属性规定元素的 tab 键控制次序(当 tab 键用于导航时)。

<!DOCTYPE html><html><body><a href="http://www.w3school.com.cn/" tabindex="2">W3School</a><br /><a href="http://www.google.com/" tabindex="1">Google</a><br /><a href="http://www.microsoft.com/" tabindex="3">Microsoft</a><p><b>注释:</b>请尝试使用键盘上的 "Tab" 键在链接之间进行导航。</p></body></html>

用tab键进行切换的时候,首先切换到tabindex值小的元素上,上例,首先切换到Google,然后W3School,最后Microsoft

以下元素支持 tabindex 属性:<a>, <area>, <button>, <input>, <object>, <select> 以及 <textarea>。

3.autocomplete
autocomplete 属性是 HTML5 中的新属性
autocomplete 属性规定表单是否应该启用自动完成功能。
自动完成允许浏览器预测对字段的输入。当用户在字段开始键入时,浏览器基于之前键入过的值,应该显示出在字段中填写的选项。
注释:autocomplete 属性适用于 <form>,以及下面的 <input> 类型:text, search, url, telephone, email, password, datepickers, range 以及 color。

<form autocomplete="on|off">

默认为on开启

4.required
required 属性是 HTML5 中的新属性。

<form action="demo_form.asp" method="get">  Name: <input type="text" name="usr_name" required="required" />  <input type="submit" /></form>

required 属性规定必需在提交之前填写输入字段。
如果使用该属性,则字段是必填(或必选)的。

注:参考http://www.w3school.com.cn/的内容

0 0
原创粉丝点击