You are here: Re: xhtml and input tag outside form « HTML « IT news, forums, messages
Re: xhtml and input tag outside form

Posted by Jukka K. Korpela on 01/23/08 11:13

Scripsit Toby A Inkster:

> <input> (and <textarea>, <button>) is an inline element, like <span>
> or <em>, so can be used in any context where inline content is
> allowed, which is virtually everywhere.

Well, not quite everywhere. Not in the document's head, and in Strict,
not in its body either. :-)

(Just kidding. But really, in Strict versions, <input> is not allowed
_directly_ inside <body>, i.e. as a child element, only indirectly
inside a block-like container.)

> Why? Because otherwise <input> couldn't be contained in, for example,
> a paragraph, even if that paragraph was itself within a form,

No, the syntax rules _could_ have been written so that <input> is only
allowed inside a <form> directly or indirectly. That would be fairly
simple in classic HTML, nominally based on SGML (which has exclusion
exceptions). It would not be possible at the DTD level in XHTML, based
on the toy version of SGML called XML, but it could have been added as
requirement in prose, just as XHTML 1.0 prosaically forbids an <a>
element inside an <a> element even though its DTD syntax allows it.

The real reason is that people who decided on HTML specs wanted to allow
lone <input> elements for use with client-side scripting.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация