[thelist] Looking up references for HTML

David Dorward evolt at david.us-lot.org
Tue Jul 6 03:27:34 CDT 2004


On 6 Jul 2004, at 09:14, Burhan Khalid wrote:

> Greetings Everyone :
>
>   I wanted to find out if there was a onclick event defined for the 
> body element.  The first place I looked was w3.org, where I looked at 
> http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd and didn't 
> find onclick in the list of attributes for the body tag, so I thought 
> that the onclick event isn't defined for body.

>   My question is, where do I look at the w3.org to find this 
> information ... and what is the definitive answer? Did I search in the 
> wrong places?

DTDs are a little tricky to read ...

<!ELEMENT body %Flow;>
<!ATTLIST body
   %attrs;

Leads to:

<!ENTITY % attrs "%coreattrs; %i18n; %events;">

Leads to:

<!ENTITY % events
  "onclick     %Script;       #IMPLIED

Its generally easier to go to the version designed for human 
consumption (rather then the DTD which is for machines).

http://www.w3.org/TR/html4/index/attributes.html

> Also -- if there is a javascript function defined for the onclick 
> event  on the body tag, and another function defined for the onclick 
> event for any other tag, do the two functions get called in order? 
> Body->onclick, then Tag->onclick?

This is a complicated one... 
http://www.quirksmode.org/js/events_order.html


--
David Dorward
      <http://dorward.me.uk/>
<http://blog.dorward.me.uk/>



More information about the thelist mailing list