這篇文章主要為大家展示了HTML5中form新增的屬性是什么,內(nèi)容簡而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶大家一起來研究并學習一下“HTML5中form新增的屬性是什么”這篇文章吧。
html的全稱為超文本標記語言,它是一種標記語言,包含了一系列標簽.通過這些標簽可以將網(wǎng)絡上的文檔格式統(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 元素應該自動獲得焦點。
如果使用該屬性,則 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>
以上就是關于“HTML5中form新增的屬性是什么”的內(nèi)容,如果改文章對你有所幫助并覺得寫得不錯,勞請分享給你的好友一起學習新知識,若想了解更多相關知識內(nèi)容,請多多關注創(chuàng)新互聯(lián)網(wǎng)站制作公司行業(yè)資訊頻道。
分享名稱:HTML5中form新增的屬性是什么-創(chuàng)新互聯(lián)
文章源于:http://aaarwkj.com/article20/dspsco.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供全網(wǎng)營銷推廣、網(wǎng)站策劃、網(wǎng)站導航、定制開發(fā)、企業(yè)網(wǎng)站制作、外貿(mào)網(wǎng)站建設
聲明:本網(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)
猜你還喜歡下面的內(nèi)容