开发者

In proper HTML, must an <input> be in a <form>?

开发者 https://www.devze.com 2022-12-31 07:20 出处:网络
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 leg

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 fre开发者_运维百科e-standing?


No. You only need a form if you're submitting to a server.


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"

0

精彩评论

暂无评论...
验证码 换一张
取 消