Re: PHP & JavaScript

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dave Goodchild wrote:
> I think it's a case of using id for javascript, not for css...

Call me a purist, but quoting http://www.w3.org/TR/xhtml1/ (and you
can probably find likewise paragraphs in other xhtml specs, all
stemming from the basic XML property that id's are unique):

"4.10. The elements with 'id' and 'name' attributes

HTML 4 defined the name attribute for the elements a, applet, form,
frame, iframe, img, and map. HTML 4 also introduced the id
attribute. Both of these attributes are designed to be used as
fragment identifiers.

In XML, fragment identifiers are of type ID, and there can only be a
single attribute of type ID per element. Therefore, in XHTML 1.0 the
id attribute is defined to be of type ID. In order to ensure that
XHTML 1.0 documents are well-structured XML documents, XHTML 1.0
documents MUST use the id attribute when defining fragment
identifiers on the elements listed above. See the HTML Compatibility
Guidelines for information on ensuring such anchors are backward
compatible when serving XHTML documents as media type text/html.

Note that in XHTML 1.0, the name attribute of these elements is
formally deprecated, and will be removed in a subsequent version of
XHTML."

So, using the same ID produces non-valid documents if you ask me.

Best,

Koen

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux