繁体   English   中英

HTML5中type属性的用法

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM