also, "if(this.checked==true)" can be shortened to "if(checked)".
I don't think that I would recommend that shortcut. While it is the case
that many (and most modern) browsers provide a custom scope handling
mechanism for the event handling functions generated from event
attribute string by the browser and, although those mechanisms differ
considerably between browser implementations, that would result in the
identifier "checked" being resolved as a property of the checkbox, there
are browsers that do not provide any such scope handling mechanism.
Opera <= 6 being an example (though I would be surprised if there were
not others).
The internally generated event handling functions in Opera 6 resolve
scope exactly as if they were JavaScript defined function objects
assigned to the event properties of the corresponding DOM nodes. As a
result "checked", unqualified, is a reference to a (undefined?) global
variable. However, the - this - keyword is required by the language to
refer to the object to which the event handling function is attached
(and called) as a method.
My conclusion was that the best cross-browser support when writing even
handling attribute string would be achieved by behaving as if there was
no special scope handling mechanism associated with the resulting
function and write the same code as would be needed in a function
attached to the DOM node with JavaScript. So the object itself should be
accessed as - this -, the form as - this.form -, and so on.
Richard.