I've searched, but didn't find answer to this question. Should HTML DOM EVENTS, like onChange, onSelect, onKeyUp, onFocus, onClick etc. contain semicolon, example two lines below.
onChange="this.form.submit();" OR onChange="this.form.submit()"
"YES" or "NO" or "Doesn't Matter"
I guess it doesn't matter, but again, what's the best, most right to do?
THANKS ALL!
It doesn't matter.
The event handler attribute value is treated as a series of statements which are wrapped in a function signature similar to
function (event) {
with (event.target.ownerDocument) {
with (event.target) {
// attribute body goes here
}
}
}
so you can put any group of SourceElement
s in the attribute value, and can leave off semicolons as per JavaScript's usual semicolon insertion rules.
Never used it with semicolon, so I guess it doesn't matter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With