亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

HTML基礎(chǔ)教程之表單中的單行文本域和密碼域

單行文本域

語(yǔ)法格式:

<input ?type = “text”?屬性 = “值”?/>

常用屬性

  • name:文本框的名字。命名規(guī)則是:可以包含字母、數(shù)字、下劃線(xiàn),只能以字母開(kāi)頭。

  • type:表單元素的類(lèi)型。

  • value:文本框中的值。

  • size:文本框的長(zhǎng)度,以“字符”為單位。

  • maxLength:最多可以輸入多少個(gè)字符,超出的就輸不進(jìn)去了。

  • readonly:只讀屬性。可以選中,但不能修改。如:readonly = “readonly”

  • disabled:禁用屬性。不能選中,不能修改。如:?disabled = “disabled”

舉例說(shuō)明:

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


單行密碼域

語(yǔ)法格式:

<input ?type = “password”?屬性 = “值”??/>

常用屬性

  • name:密碼框的名字。命名規(guī)則是:可以包含字母、數(shù)字、下劃線(xiàn),只能以字母開(kāi)頭。

  • type:表單元素的類(lèi)型。

  • value:元素中的值。

  • size:元素的長(zhǎng)度,以“字符”為單位。

  • maxLength:最多可以輸入多少個(gè)字符,超出的就輸不進(jìn)去了。

  • readonly:只讀屬性??梢赃x中,但不能修改。如:readonly = “readonly”

  • disabled:禁用屬性。不能選中,不能修改。如:?disabled = “disabled”


實(shí)例:

<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>用戶(hù)注冊(cè)</title>
    </head>
    <body>
        <font size="5" color="red">歡迎注冊(cè)php.cn</font>
        <form name="user" method="get" action="" >
            用戶(hù)名:<input type="text" name="username" value="請(qǐng)輸入您的用戶(hù)名" maxLength="6"/>
            <br/>
            密碼:<input type="password" name="userpwd" maxLength="6"/>
            <br/>
            <input type="submit" value="提交信息"/>
        </form>
    </body>
</html>

大家也可以輸入其他屬性,查看結(jié)果

繼續(xù)學(xué)習(xí)
||
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>用戶(hù)注冊(cè)</title> </head> <body> <font size="5" color="red">歡迎注冊(cè)php.cn</font> <form name="user" method="get" action="" > 用戶(hù)名:<input type="text" name="username" value="請(qǐng)輸入您的用戶(hù)名" maxLength="6"/> <br/> 密碼:<input type="password" name="userpwd" maxLength="6"/> <br/> <input type="submit" value="提交信息"/> </form> </body> </html>
提交重置代碼