ShellRox ShellRox - 1 year ago 73
HTML Question

Is it correct to use FORM to the INPUT that is inside DIV?

I have been wondering about usage of HTML

tag. I needed it for my
elements that are inside

<div id="container1">
<input type="text" name="first" id="name">
<div id="container2">
<input type="text" name="second" id="surname">

Is it correct and natural to do this? would this capture all input elements inside form? If not is there any better way or any other way to achieve this?

Answer Source

form is a block-level element in HTML. Typically, block-level elements allow both block-level and inline children.

Both div and span are valid children of form.

This link would help you to understand better

but You can always use W3C Markup Validation Service to check your html.

Hope this would help. You can also read about Box Modle for more understanding on this subject.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download