Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

第 67 期(W3C 标准-HTML):form 特性 #70

Copy link
Copy link
@wingmeng

Description

@wingmeng
Issue body actions

HTML5 中的表单,无论是在表现方面,还是在功能方面,都非常优越,使用 HTML5 表单的某些特性,可以轻松的开发出以往需要写大量代码的表单页面效果。

今天要介绍的是表单的 form 特性,利用它可以把从属于表单的元素放在任何地方,只需指明该元素的 form 特性值为表单 id 即可,这样该元素就从属于表单了。

<!-- 这里用 form="form1" 指明对应的表单 -->
<input type="text" name="username" form="form1" required>

<form id="form1">
  <input type="submit" value="提交">
</form>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.