首页 > 其他 > 详细

表单元素

时间:2019-07-20 11:56:57      阅读:79      评论:0      收藏:0      [点我收藏+]

表单元素 input textarea  button select  h5新增(datalist  keygen output)

input标签的输入类型

text

password

hidden

button

submit

reset

image

radio

checkbox

file

h5新增

  • color
  • date
  • datetime
  • datetime-local
  • email
  • month
  • number
  • range
  • search
  • tel
  • time
  • url
  • week
  • --------------------------------------------------------------------------------------------

<!-- 每一个表单元素要想被提交必须加name属性 -->

  文本类:

文本框    <input type = "text" />

密码框    <input type = "password" />

隐藏域    <input type = "hidden" />

文本域    <textarea></textarea>

 

按钮类:

普通按钮  <input type = "button" value  = "text" />

提交按钮  <input type = "submit" value = "提交" />

重置按钮  <input type = "reset" value = "重置" />

图片按钮  <input type = "image" />

 <button type="" name=></button>

选择类:

//同一个单选按钮组或者复选按钮组。name属性值要相同

//

<label> 标签为 input 元素定义标注(标记)。

label 元素不会向用户呈现任何特殊效果。不过,它为鼠标用户改进了可用性。如果您在 label 元素内点击文本,就会触发此控件。就是说,当用户选择该标签时,浏览器就会自动将焦点转到和标签相关的表单控件上。

<label> 标签的 for 属性应当与相关元素的 id 属性相同。

 

<input type = "radio" value = "1" id = "ra1">

<label for = "ra1">男</label>

 

<input type = "checkbox" value = "" id = ""><label  for = ""></label>

 

<select>

      <option vale = "1"></option>

</select>

 

<input type = "file" />

 

HTML5 增加了如下表单元素:

  • <datalist>
  • <keygen>
  • <output>

注释:默认地,浏览器不会显示未知元素。新元素不会破坏您的页面。

表单元素

原文:https://www.cnblogs.com/cui-ting/p/11216725.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!