简体   繁体   中英

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

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“,”address“,”fieldset“

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM