html中表单元素_HTML中的表单元素

html中表单元素

1)<input>元素 (1) The <input> Element)

The <input> element is used to get input from the user in an HTML form.

<input>元素用于以HTML形式从用户获取输入。

<input> tag is used to get input using input element, the type attribute of the input element is used to define inputs of multiple types in HTML.

<input>标记用于使用input元素获取输入,input元素的type属性用于定义HTML中多种类型的输入。

Syntax:

句法:

<input name="email" type="text" />

For the input element there are more values which will be discussed later.

对于输入元素,还有更多值,将在后面讨论。

2)<select>元素 (2) The <select> Element)

The select element is used to define the drop-down list (select Box) in the HTML form.

select元素用于定义HTML表单中的下拉列表(选择框)。

The <select> tag is used to define the list. Also, two more tags are required with the <select> tag for the work. They are <value> and <selected>.

<select>标记用于定义列表。 此外,还需要两个标签以及<select>标记才能进行工作。 它们是<value>和<selected> 。

The <value> tag defines an option that can be selected in the drop-down list.

<value>标记定义了一个可以在下拉列表中选择的选项。

The <selected> tag is used to define the element which is preselected in the form. By default, if no option is marked selected the first element is selected.

<selected>标签用于定义在表单中预先选择的元素。 默认情况下,如果未标记任何选项,则选择第一个元素。

Syntax:

句法:

<select name="bikes">
<option value="value" selected> text </option>
. . .
</select>

In select tags, you can also select the number of options that are visible directly to the user without clicking on dropdown.

在选择标签中,您还可以选择直接对用户可见的选项数量,而无需单击下拉菜单。

This is done by using the size attribute.

这是通过使用size属性来完成的。

Syntax:

句法:

<select name="name" size="3"> ... </select>

This will show 3 options directly.

这将直接显示3个选项。

In the select box, the user is allowed to select more that one (multiple) options. This is done by adding multiple attributes.

在选择框中,允许用户选择一个以上(多个)选项。 这可以通过添加多个属性来完成。

Syntax:

句法:

<select multiple> ... </select>

3)<textarea>元素 (3) The <textarea> Element)

The <textarea> element is used to define the text area input i.e. a multi-line input field in the HTML form.

<textarea>元素用于定义文本区域输入,即HTML表单中的多行输入字段。

This element needs the rows and cols attribute to be defined to set the number of rows and columns the <textarea> will occupy.

该元素需要定义rows和cols属性,以设置<textarea>将占用的行数和列数。

Syntax:

句法:

<textarea rows="5" cols="10"> text_to_displayed </textarea>

The dimensions of the <textarea> can also be defined using stylesheet in HTML.

<textarea>的尺寸也可以使用HTML中的样式表定义。

Syntax:

句法:

<textarea style="width:100px; height: 250px;"> text_to_displayed </textarea>

4)<Button>元素 (4) The <Button> Element)

The <button> element is HTML form is used to add a button to the form that can be clicked to perform actions in the form.

<button>元素是HTML表单,用于向表单添加按钮,可以单击该按钮以执行表单中的操作。

Syntax:

句法:

<button type="button" onclick="action_performed"> text </button>

5)<datalist>元素 (5) The <datalist> Element)

The <datalist> element in HTML form is used to define a list of data elements that are predefined for the input element. It will create a drop-down of all the input options available.

HTML形式的<datalist>元素用于定义为输入元素预定义的数据元素列表。 它将创建所有可用输入选项的下拉列表。

To connect the <input> element to the <datalist>, the id of the datalist is to be referred by the list attribute of the input tag.

要将<input>元素连接到<datalist> ,该数据列表的id将由输入标签的list属性引用。

Syntax:

句法:

<input list="datalist_id"/>
<datalist="datalist_id">
<option>... </option>
<option>... </option>
<option>... </option>
</datalist>

6)<output>元素 (6) The <output> Element)

The <output> element in HTML form is used to return the result of some calculations that are done in realtime in the form.

HTML表单中的<output>元素用于返回以该表单实时完成的一些计算的结果。

<output> tag is used to define the output. Also, one on the input tag is used to define the operation.

<output>标记用于定义输出。 另外,输入标签上的一个用于定义操作。

Syntax:

句法:

<oninput="output_name.value= parseInt(input1.value) * parseInt(input2.value) "> 0
<input name="input1">
<input name="input2">
<output name="output_name" for="input1 input2"></output>

翻译自: https://www.includehelp.com/html/form-elements.aspx

html中表单元素

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/377058.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

《搜索算法——DFS、BFS、回溯》

目录深搜200. 岛屿数量695. 岛屿的最大面积130. 被围绕的区域547. 省份数量417. 太平洋大西洋水流问题回溯广搜111. 二叉树的最小深度752. 打开转盘锁深搜与广搜结合934. 最短的桥深搜 深搜DFS&#xff0c;在搜索到一个新节点时&#xff0c;立即对该新节点进行遍历&#xff0c…

AP in R

AP聚类算法是目前十分火的一种聚类算法&#xff0c;它解决了传统的聚类算法的很多问题。不仅简单&#xff0c;而且聚类效果还不错。这里&#xff0c;把前两天学习的AP算法在R语言上面的模拟&#xff0c;将个人笔记拿出来与大家分享一下&#xff0c;不谈AP算法的原理&#xff0c…

nginx 模块解析

nginx的模块非常之多&#xff0c;可以认为所有代码都是以模块的形式组织&#xff0c;这包括核心模块和功能模块&#xff0c;针对不同的应用场合&#xff0c;并非所有的功能模块都要被用到&#xff0c;附录A给出的是默认configure&#xff08;即简单的http服务器应用&#xff09…

python关键字和保留字_Python关键字

python关键字和保留字关键词 (Keywords) Keywords are the reserved words in Python programming language (and, any other programming languages like C, C, Java, etc) whose meanings are defined and we cannot change their meanings. In python programming languages…

《LeetcodeHot100非困难题补录》

最近比较闲&#xff0c;也比较焦虑&#xff0c;刷刷题吧 目录11. 盛最多水的容器22. 括号生成31. 下一个排列48. 旋转图像49. 字母异位词分组56. 合并区间75. 颜色分类79. 单词搜索114. 二叉树展开为链表141. 环形链表148. 排序链表152. 乘积最大子数组169. 多数元素207. 课程表…

Java里String.split需要注意的用法

我们常常用String的split()方法去分割字符串&#xff0c;有两个地方值得注意&#xff1a; 1. 当分隔符是句号时(".")&#xff0c;需要转义&#xff1a; 由于String.split是基于正则表达式来分割字符串&#xff0c;而句号在正则表达式里表示任意字符。 //Wrong: //Str…

C# Socket 例子(控制台程序)

服务器代码 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; using System.Net.Sockets; using System.IO;namespace TCPListener {class Program{static void Main(string[] args){const int BufferSize 1024;Con…

Scala中的值类

Value classes are a special mechanism in Scala that is used to help the compiler to avoid allocating run time objects. 值类是Scala中的一种特殊机制&#xff0c;用于帮助编译器避免分配运行时对象。 This is done by defining a subclass of AnyVal. The only parame…

《MySQL8.0.22:Lock(锁)知识总结以及源码分析》

目录1、关于锁的一些零碎知识&#xff0c;需要熟知事务加锁方式&#xff1a;Innodb事务隔离MVCC多版本并发控制常用语句 与 锁的关系意向锁行级锁2、锁的内存结构以及一些解释3、InnoDB的锁代码实现锁系统结构lock_sys_tlock_t 、lock_rec_t 、lock_table_tbitmap锁的基本模式的…

关于ORA-04021解决办法(timeout occurred while waiting to lock object)

某个应用正在锁定该表或者包 表为 select b.SID,b.SERIAL#,c.SQL_TEXT from v$locked_object a, v$session b, v$sqlarea c where a.SESSION_ID b.SID and b.SQL_ADDRESS c.ADDRESS and c.sql_text like %table_name% 包为 select B.SID,b.USERNAME,b.MACHINE FROM V$ACCESS …

HtmlAutoTestFrameWork

前段时间做的自动化测试的是Silverlight的&#xff0c;框架都已经搭好。突然测试发现这里还有一个要发送邮件的html页面&#xff0c;并且将另外启动浏览器&#xff0c;于是今天下午把这个html的也写出来。用法 &#xff1a; HtmlAutoTestFrameWork htf new HtmlAutoTestFrameW…

L8ER的完整形式是什么?

L8ER&#xff1a;稍后 (L8ER: Later) L8ER is an abbreviation of "Later". L8ER是“ Later”的缩写 。 It is an expression, which is commonly used in messaging or chatting on social media networking sites like Facebook, Yahoo Messenger, and Gmail, etc…

Randomize select algorithm 随机选择算法

从一个序列里面选择第k大的数在没有学习算法导论之前我想最通用的想法是给这个数组排序&#xff0c;然后按照排序结果返回第k大的数值。如果使用排序方法来做的话时间复杂度肯定至少为O&#xff08;nlgn&#xff09;。 问题是从序列中选择第k大的数完全没有必要来排序&#xff…

《Linux杂记:一》

目录CPU负载和CPU利用率CPU负载很高,利用率却很低的情况负载很低,利用率却很高常用linux命令常用的文件、目录命令常用的权限命令常用的压缩命令CPU负载和CPU利用率 可以通过 uptime , w 或者 top 命令看到CPU的平均负载。 Load Average :负载的3个数字,比如上图的0.57、0.4…

IOS Plist操作

代码&#xff1a;copy BUNDLE下的plist文件 到 library下面。 bundle下不支持些&#xff0c;library&#xff0c;doc路径支持读与写。 (void)copyUserpigListToLibrary {NSFileManager *fileManager [NSFileManager defaultManager];NSArray *paths NSSearchPathForDirector…

《线程管理:线程基本操作》

目录线程管理启动线程与&#xff08;不&#xff09;等待线程完成特殊情况下的等待&#xff08;使用trycath或rall&#xff09;后台运行线程线程管理 启动线程与&#xff08;不&#xff09;等待线程完成 提供的函数对象被复制到新的线程的存储空间中&#xff0c;函数对象的执行…

scala特质_Scala的特质

scala特质Scala特质 (Scala traits) Traits in Scala are like interfaces in Java. A trait can have fields and methods as members, these members can be abstract and non-abstract while creation of trait. Scala中的特性类似于Java中的接口 。 特征可以具有作为成员的…

优化PHP代码的40条建议(转)

优化PHP代码的40条建议 40 Tips for optimizing your php Code 原文地址&#xff1a;http://reinholdweber.com/?p3 英文版权归Reinhold Weber所有&#xff0c;中译文作者yangyang&#xff08;aka davidkoree&#xff09;。双语版可用于非商业传播&#xff0c;但须注明英文版作…

Iptables入门教程

转自&#xff1a;http://drops.wooyun.org/tips/1424 linux的包过滤功能&#xff0c;即linux防火墙&#xff0c;它由netfilter 和 iptables 两个组件组成。 netfilter 组件也称为内核空间&#xff0c;是内核的一部分&#xff0c;由一些信息包过滤表组成&#xff0c;这些表包含内…

《线程管理:传递参数、确定线程数量、线程标识》

参考《c Concurrency In Action 》第二章做的笔记 目录传递参数量产线程线程标识传递参数 thread构造函数的附加参数会拷贝至新线程的内存空间中&#xff0c;即使函数中的采纳数是引用类型&#xff0c;拷贝操作也会执行。如果我们期待传入一个引用&#xff0c;必须使用std::re…