位置:首頁 > 軟件操作教程 > 編程開發(fā) > HTML > 問題詳情

2.3.6.4 下拉列表:從列表中選擇一個或多個選項 HTML

提問人:劉團(tuán)圓發(fā)布時間:2020-11-03

基本語法

<select name=* size=** multiple>    <optgroup label=“分組選項類別名"> 

     <option selected value=**>說明</option>

     <option value=**>說明2 </option>

  </optgroup>

</select>                          

multiple:有該項說明可以選擇多項

示例 

表單示例:代碼

<HTML>  <HEAD>

<TITLE>Listing 4-2</TITLE>

</HEAD>

<BODY><FORM NAME="F1" ACTION="http://ms.com/asp/prc.asp" METHOD="get">//由網(wǎng)站http://ms.com 的jsp目錄下的prc.jsp程序處理。 

<INPUT NAME="t1" TYPE="text" VALUE="This is a text input"><BR>

<INPUT NAME=“p1” TYPE=“password” VALUE=“A password input”><BR>//控件類型

<INPUT NAME="c1" TYPE="checkbox" VALUE="Checkbox 1">

This text is next to check box 1.<BR>

<INPUT NAME="c2" TYPE="checkbox" VALUE="Checkbox 2">

This text is next to check box 2.<BR>

<INPUT NAME=“r1” TYPE=“radio” VALUE=“first radio ”>//name值必須一致

This text is next to the first radio button.<BR>

<INPUT NAME="r1" TYPE="radio" VALUE="second radio">

This text is next to the second radio button.<BR>

<INPUT NAME="b1" TYPE="button" VALUE="Just a button"><BR>

<INPUT NAME="f1" TYPE="file" VALUE="This is a file input"><BR>

<INPUT NAME="h1" TYPE="hidden" VALUE="A hidden input"><BR>

<INPUT NAME="rst" TYPE="reset" VALUE="A reset button"><BR>

<INPUT NAME="sbt" TYPE="submit" VALUE="A submit button"><BR>

<INPUT NAME="i1" TYPE="image" VALUE="An Image" SRC="a.gif"><BR>

<TEXTAREA NAME=“TA1” COLS=“40” ROWS=“4” WRAP=“soft”>//自動換行的文本域

  This text is inside TEXTAREA 1. Note how lines of code are

  automatically wrapped and how line breaks in the code cause breaks.

</TEXTAREA>

</FORM>

</BODY></HTML>

表單示例:圖示

image.png

文本域示例:代碼

<HTML>

<HEAD>

<TITLE>Listing 4-3</TITLE>

</HEAD>

<BODY>

<FORM NAME="F1" ACTION="http://ms.com/asp/prc.asp" METHOD="GET">

<TEXTAREA NAME="TA1" COLS="40" ROWS="4" WRAP="soft">

  This text is inside TEXTAREA 1. Note how lines of code are

  automatically wrapped and how line breaks in the code cause breaks.

</TEXTAREA>

<BR>

<TEXTAREA NAME="TA2" COLS="40" ROWS="4" WRAP="off">

  This text is inside TEXTAREA 2. Note how lines of code are 

  not automatically wrapped and how line breaks in the code cause breaks.

</TEXTAREA>

<BR><INPUT TYPE="submit">

</FORM>

</BODY>

</HTML>

文本域示例:圖示

image.png

下拉列表示例:代碼

image.png

下拉列表示例:圖示

image.png


繼續(xù)查找其他問題的答案?

相關(guān)視頻回答
回復(fù)(0)
返回頂部