[html5]记一些html5的东西

1级标题代表标签
2级标题代表属性

input

form

这里是MDN上面的解释

The form element that the input element is associated with (its form owner). The value of the attribute must be an id of a element in the same document. If this attribute is not specified, this element must be a descendant of a element. This attribute enables you to place elements anywhere within a document, not just as descendants of their form elements.

一般input标签都是放在form标签里面去提交的,但现在,允许将input标签放在任何地方,只要给input设置form属性,值为form标签的id值。

例如这样:

<form id="form" action="/">
    <button>submit</button>
</form>
<input form="form" type="hidden" name="id" value="001">

这样点击submit按钮后,就会自动带上 id=001 这个参数了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值