使用 HTML 中的 form 属性来设置元素在 HTML 中所属的一个或多个表单的名称。
示例
您可以尝试运行以下代码来实现form属性 –
<!DOCTYPE html>
<html>
<body>
<form action = "" method = "get" id = "myform">
SubjectID: <input type = "number" name = "subid"><br>
Subject Name: <input type = "text" name = "subname"><br>
Total Students: <input type="number" name = "stcount"><br>
</form>
<button type = "submit" form = "myform" value = "Submit">Click</button>
</body>
</html>
登录后复制
以上就是在HTML中,将元素所属的表单的名称设置为什么?的详细内容,更多请关注www.92cms.cn其它相关文章!






