前端基础02

2017-01-15  本文已影响0人  IT男的成长记录

1.form表单有什么作用?有哪些常用的input标签,分别有什么作用?

    <input type="text">:定义用于文本输入的单行输入字段(默认宽度为20个字符)
   <input type="password">:定义密码字段
   <input type="radio">:定义单选按钮,允许用户在有限数量的选项中选择一个
   <input type="checkbox">:定义复选框
   <input type="submit">:定义用于向表单处理程序提交表单的按钮。
   <input type="button">:定义按钮
   <input type="number">:用于应该包含数字值的输入字段
   <input type="date">:用于应该包含日期的输入字段
   <input type="color">:用于应该包含颜色的输入字段,根据浏览器支持,颜色选择器会出现输入字段中。
   <input type="range">:用于应该包含一定范围内的值的输入字段,根据浏览器支持,输入字段能够显示为滑动控件
   <input type="month">:允许用户选择月份和年份,根据浏览器的支持,日期选择器会出现在输入字段中
   <input type="week">:允许用户选择周和年,根据浏览器支持,日期选择器会出现输入字段中。
   <input type="time">:允许用户选择时间(无时区),根据浏览器支持,时间选择器会出现输入字段中。
   <input type="datetime">:允许用户选择日期和时间(有时区),根据浏览器支持,日期选择器会出现输入字段中。
   <input type="datetime-local">:允许用户选择日期和时间(无时区),根据浏览器支持,日期选择器会出现输入字段中。
   <input type="email">:用于应该包含电子邮件地址的输入字段,根据浏览器支持,能够在被提交时自动对电子邮件地址进行验证。
   <input type="search">:用于搜索字段(搜索字段的表现类似常规文本字段)。
   <input type="tel">:用于应该包含电话号码的输入字段,目前只有Safari 8支持该类型
   <input type="url">:用于应该包含URL地址的输入字段,根据浏览器的支持,在提交时能够自动验证url字段。

2.post和get方式有说明区别

3.在input里,name有什么作用

<input type="text" name="username">
<input type="password" name="password">
//在java程序中通过name来获取用户输入
String name = request.getParameter("username");
String password = request.getParameter("password");

4.radio如何分组

<input type="radio" name="city" value="beijing">北京
<input type="radio" name="city" value="shanghai">上海
<input type="radio" name="city" value="hangzhou">杭州

<input type="radio" name="gender" value="male">男
<input type="radio" name="gender" value="female">女

5.placeholder属性有什么作用

6.type=hidden隐藏域有什么作用?举例说明

7.html form页面

https://yan358941877.github.io/task/task05.html

上一篇 下一篇

猜你喜欢

热点阅读