The Script Attribute Type is a data type defined by XHTML Modularisation 1.1, declared in the DTD as XML 1.0 type CDATA.
Reference: *W3C - XHTML Modularisation 1.1 - Attribute Types
onblur:a, area, label, input, textarea, select, buttononchange:input type="text", input type="password", input type="file", input type="checkbox", input type="radio", textarea, selectonfocus:a, area, label, input, textarea, select, buttononload:bodyonreset:formonselect:input type="text", input type="password", input type="file", textareaonsubmit:formonunload:bodyonclickondblclickonmousedownonmouseuponmouseoveronmousemoveonmouseoutonkeypressonkeydownonkeyupA script expression to be passed to the appropriate scripting engine
If you use any attributes of Type Script, the MIME type of the scripting language used should always be provided in a Content-Script-Type HTTP header.
It is good practice not to use these attributes, however,
and instead to include external scripts (via
script elements)
which add any handlers unobtrusively. This makes code more self-contained and
also the XHTML is easier to maintain if it doesn't contain any events attributes.
< (or <).<) must be escaped as & (or &)."
(or ") if using double quotes to delimit the attribute value'
if using single quotes to delimit the attribute value
(alternatively ' may be used if compatibility with HTML isn't necessary
- see Character Entities Predefined by XML 1.0)For example, the invalid ampersand characters in the following script attribute have been escaped as &
Each of the & entity references in the above example will be replaced by an ampersand character by the XML Processor
during *Attribute-Value Normalisation. The upshot of this is that
the scripting engine will not see the entity references but instead the intended onload code:
if ( myobj && myobj.setup ) myobj.setup();