[thelist] Adding attributes for tags
James Hardy
evolt at weeb.biz
Tue Jul 12 03:49:59 CDT 2005
Christian Heilmann wrote:
>>>I've modified Peter's defaults to use two "new" attributes -- chk and
>>>emsg. I'm not getting
>>> Line 62, column 25: there is no attribute "chk"
>>>stuff. I'm using a DOCTYPE of xhtml1 transitional so these should not
>>>be coming up -- to my understanding.
>>>
>>>So I thought "There has got to be a way to declare these" so the
>>>document passes. My understanding of XML and friends is still a little
>>>sketchy but I think there should be a way to do this.
>>>
>>>Pointers, directions, or search terms would be appreciated.
>>>
>>>
>>If I understand your problem correctly, you could add the attributes
>>via JavaScript and DOM.
>>
>>See:
>>http://www.devguru.com/Technologies/xmldom/quickref/element_setAttribute.html
>>
>>
>
>That has nothing to do with _validating custom attributes_ though.
>The above error shows the attributues are already in the markup. An
>own DTD helps validating them:
>
>http://www.alistapart.com/articles/customdtd/
>http://www.alistapart.com/articles/scripttriggers/
>
>If it is worth the hassle is up to you tough :-)
>
>
>
But if you left them out of the XHTML and then added the attributes to
the elements using JS and DOM via the body.onload, it would validate but
the elements would have those attributes when they needed to be refered to.
More information about the thelist
mailing list