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.pswp.cn/news/377058.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/377058.shtml
英文地址,請注明出處:http://en.pswp.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…