當前位置:軟件學堂 > 資訊首頁 > 網絡編程 > DIV+CSS > 表單中的密碼域password

表單中的密碼域password

2012/11/21 15:11:13作者:佚名來源:網絡

移動端

【實例介紹】

表單中的密碼域password

在表單中還有一種文本字段的形式——密碼域,輸入到其中的文字均以星號“*”或圓點“●”顯示。

【基本語法】

<input  name="密碼域的名稱"  type="password"  value="密碼域的默認取值"  size"密碼域的長度"  maxlength"最多字符數"/>

【語法介紹】

在該語法中包含了很多參數,它們的含義和取值方法不同,如表所示。

密碼域的參數值
屬性                描述
name           密碼域的名稱,用于和頁面中其他控件加以區別。名稱由英文、數字以及下畫線組成,有大小寫之分
type              指定插入哪種表單對象
value            用來定義密碼域的默認值,以“*”或“●”顯示
size              確定密碼域在頁面中顯示的長度,以字符為單位
maXlength  設置密碼域中最多可以輸入的文字數

【實例代碼】

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>密碼域</title> </head> <body> <table width="100%" cellspacing="0" cellpadding="0">   <tr>     <td><form action="mailto:weixiao@foxw.com" name="form1" method="post" enctype="application/x-www-form-urlencoded"target="_blank" >       <p>用戶名                          :           <input name="textfield" type="text" size="20" maxlength="15" />       </p>       <p>密碼:         <input name="textfield2" type="password" value="abcdef" size="25" maxlength="6" />       </p>     </form></td>   </tr> </table> </body> </html>

【代碼分析】

在代碼中,加粗的<input name="password"type="password"size="25"maxlength="6">標記將密碼域的名稱設置為password,長度設置為25,最多字符數設置為6,在瀏覽器中瀏覽,效果如圖所示。當在密碼域中輸入內容時將以“●”顯示。

密碼域password運行效果

 【素材及源碼下載】

請點擊:表單中的密碼域password 下載本實例相關素材及源碼

 

標簽: 表單    

欧美一级一极性活片免费观看,欧美一级艳片欧美精品,欧美一级性爱大片,欧美一级囗交视频 视频,欧美一级特黄录像视频