Na stronach dokumentacji HTML-a masz informacje o tym co może znajdować się bezpośrednio wewnątrz danego elementu, co nie może oraz jakie argumenty może dany element przyjąć.
Przykładowo dla elementu DIV:
http://www.w3.org/TR/html401/struct/global.html#h-7.5.4 Kod
<!ELEMENT DIV - - (%flow;)* -- generic language/style container -->
<!ATTLIST DIV
%attrs; -- %coreattrs, %i18n, %events --
>
Mogą znajdować się w nim wszystkie elementy z grupy %flow (zero lub więcej elementów). Grupa ta skupia dwie inne grupy %block i %inline. Grupa %block to następujące elementy i grupy elementów
P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT | BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS. Może on też przyjąć atrybuty z grup
%coreattrs, %i18n, %events.
I jeszcze może przykład dla elementu FORM:
http://www.w3.org/TR/html401/interact/forms.html#h-17.3 Kod
<!ELEMENT FORM - - (%block;|SCRIPT)+ -(FORM) -- interactive form -->
<!ATTLIST FORM
%attrs; -- %coreattrs, %i18n, %events --
action %URI; #REQUIRED -- server-side form handler --
method (GET|POST) GET -- HTTP method used to submit the form--
enctype %ContentType; "application/x-www-form-urlencoded"
accept %ContentTypes; #IMPLIED -- list of MIME types for file upload --
name CDATA #IMPLIED -- name of form for scripting --
onsubmit %Script; #IMPLIED -- the form was submitted --
onreset %Script; #IMPLIED -- the form was reset --
accept-charset %Charsets; #IMPLIED -- list of supported charsets --
>
Bezpośrednio w jego wnętrzu musi być element blokowy (np. DIV) lub skrypt (co najmniej jeden element), nie może być kolejnego elementu FORM w jego wnętrzu.
Oznacza to, że nie możesz dać bezpośrednio w FROM elementu INPUT (bo nie należy on do grupy elementów %block). Widać również, że element ten ma jeden wymagany atrybut ACTION.