[英]Usage of type attribute in HTML5
<body>
<form action="Welcome.html" method="get" id="user_id">
<input type="submit" formmethod="post" value="post method submit"/> </br>
<input type="submit" formtarget="_blank" value="opens in new window"/> </br>
</form>
</body>
</html>
在上面的代碼中,他們使用了type =“ submit”。 這個“提交”是預定義的,還是可以是任何東西。 我也可以使用type =“ pradeeba”(用戶定義的屬性)。
第二個查詢是關於value屬性。 對於某些標簽,我可以發現該值被提及,而在某些地方未提及值。 值是每種輸入類型的強制屬性嗎?
請幫助兩個查詢。
submit
是預定義的類型。
根據W3C http://dev.w3.org/html5/markup/input.html :
input type=text
input type=password
input type=checkbox
input type=radio
input type=button
input type=submit
input type=reset
input type=file
input type=hidden
input type=image
input type=datetime
input type=datetime-local
input type=date
input type=month
input type=time
input type=week
input type=number
input type=range
input type=email
input type=url
input type=search
input type=tel
input type=color
在我知道的所有瀏覽器中, type="pradeeba"
將呈現為type="text"
元素。
值屬性指定控件的初始值。 它是可選的。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.