HTML5中form新增的屬性是什么-創(chuàng)新互聯(lián)

這篇文章主要為大家展示了HTML5中form新增的屬性是什么,內(nèi)容簡而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶大家一起來研究并學習一下“HTML5中form新增的屬性是什么”這篇文章吧。

10余年的六盤水網(wǎng)站建設(shè)經(jīng)驗,針對設(shè)計、前端、開發(fā)、售后、文案、推廣等六對一服務(wù),響應(yīng)快,48小時及時工作處理。網(wǎng)絡(luò)營銷推廣的優(yōu)勢是能夠根據(jù)用戶設(shè)備顯示端的尺寸不同,自動調(diào)整六盤水建站的顯示方式,使網(wǎng)站能夠適用不同顯示終端,在瀏覽器中調(diào)整網(wǎng)站的寬度,無論在任何一種瀏覽器上瀏覽網(wǎng)站,都能展現(xiàn)優(yōu)雅布局與設(shè)計,從而大程度地提升瀏覽體驗。創(chuàng)新互聯(lián)建站從事“六盤水網(wǎng)站設(shè)計”,“六盤水網(wǎng)站推廣”以來,每個客戶項目都認真落實執(zhí)行。html是什么

html的全稱為超文本標記語言,它是一種標記語言,包含了一系列標簽.通過這些標簽可以將網(wǎng)絡(luò)上的文檔格式統(tǒng)一,使分散的Internet資源連接為一個邏輯整體,html文本是由html命令組成的描述性文本,html命令可以說明文字,圖形、動畫、聲音、表格、鏈接等,主要和css+js配合使用并構(gòu)建優(yōu)雅的前端網(wǎng)頁。

1.HTML 5 <input> formaction 屬性

定義和用法

formaction 屬性規(guī)定當提交表單時,向何處發(fā)送表單數(shù)據(jù)。

注意內(nèi)容:

1.formaction 屬性規(guī)定當表單提交時處理輸入控件的文件的 URL。

2.formaction 屬性覆蓋 <form> 元素的 action 屬性。

注釋:formaction 屬性適用于 type="submit" 和 type="image"。

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>formaction</title>
</head>
<body>
<form id="testform">
    <input type="submit" name="s1" value="v1" formaction="http://localhost:8080/index01/Test01.jsp">提交到http://localhost:8080/index01/Test01.jsp
    <input type="submit" name="s2" value="v2" formaction="http://localhost:8080/index01/Test02.jsp">提交到http://localhost:8080/index01/Test02.jsp
    <input type="submit" name="s3" value="v3" formaction="http://localhost:8080/index01/Test03.jsp">提交到http://localhost:8080/index01/Test03.jsp
</form>
</body>
</html>

2.HTML 5 <button> formmethod 屬性

定義和用法

formmethod 屬性覆蓋 form 元素的 method 屬性。

可以通過以下方式發(fā)送 form-data :

  • 以 URL 變量 (使用 method="get") 的形式來發(fā)送

  • 以 HTTP post (使用 method="post") 的形式來發(fā)送

該屬性與 type="submit" 配合使用。

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <form id="testform">
        <input type="submit" name="s1" value="v1" formmethod="post" formaction="http://localhost:8080/index01/Test01.jsp">http://localhost:8080/index01/Test01.jsp
        <input type="submit" name="s2" value="v2" formmethod="get" formaction="http://localhost:8080/index01/Test02.jsp">http://localhost:8080/index01/Test02.jsp
        <input type="submit" name="s1" value="v1" formmethod="post" formaction="http://localhost:8080/index01/Test03.jsp">http://localhost:8080/index01/Test03.jsp
    </form>
</body>
</html>

<!DOCTYPE HTML>
<html>
<body>
<form action="/example/html5/demo_form.asp" method="get">
  姓:<input type="text" name="lname" /><br />
  名:<input type="text" name="fname" /><br />
<button type="submit" >提交</button>
<button type="submit" formmethod="post" formaction="/example/html5/demo_post.asp">使用 POST 來提交</button>
</form>
</body>
</html>

3HTML 5 <input> autofocus 屬性

定義和用法

autofocus 屬性規(guī)定當頁面加載時 input 元素應(yīng)該自動獲得焦點。

如果使用該屬性,則 input 元素會獲得焦點。

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form>
    <input type="text">
    <input type="text" autofocus>
</form>
</body>
</html>

以上就是關(guān)于“HTML5中form新增的屬性是什么”的內(nèi)容,如果改文章對你有所幫助并覺得寫得不錯,勞請分享給你的好友一起學習新知識,若想了解更多相關(guān)知識內(nèi)容,請多多關(guān)注創(chuàng)新互聯(lián)網(wǎng)站制作公司行業(yè)資訊頻道。

分享名稱:HTML5中form新增的屬性是什么-創(chuàng)新互聯(lián)
文章源于:http://muchs.cn/article20/dspsco.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供全網(wǎng)營銷推廣、網(wǎng)站策劃網(wǎng)站導(dǎo)航、定制開發(fā)、企業(yè)網(wǎng)站制作、外貿(mào)網(wǎng)站建設(shè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

網(wǎng)站托管運營