在正确的HTML中,必须有< input>在< form>中? [英] In proper HTML, must an <input> be in a <form>?

查看:113
本文介绍了在正确的HTML中,必须有< input>在< form>中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一些输入元素,但它们的值不会被提交到任何地方 - 它们只会被一些客户端JavaScript操纵。我是否必须将它们放在< form> 中才能拥有合法的HTML,或者它们可以独立存在?

I need a few input elements, but their values won't be submitted anywhere - they're just going to be manipulated by some client-side JavaScript. Do I have to place them in a <form> to have legit HTML, or can they just be free-standing?

推荐答案

有关其他信息,请在xhtml strict中放置以下其中一个元素:ins,del,h1,h2,h3 ,h4,h5,h6,p,div,地址,字段集

For additional information, in xhtml strict you have to place in one of these elements: "ins", "del", "h1", "h2", "h3", "h4", "h5", "h6", "p", "div", "address", "fieldset"

这篇关于在正确的HTML中,必须有&lt; input&gt;在&lt; form&gt;中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆