How do I respond to all the mouse clicks on a page?
This works
<html xmlns="http://www.w3.org/1999/xhtml" onclick="formSubmit()">
…but I get the warning
Validation (XHTML 1.0 Transitional): Attribute ‘onclick’ is not a valid attribute of element ‘html’.
So what is the correct way to do something like this?
Try to capture mouse events rather than onlclicks
This will be more effective.
For example, this captures a right click.
But different browsers behave differently.
I tried the body element, but clicks outside the form are not captured.
I should have mentioned earlier that the browser is IE6.
Good question, i was wondering that too, sorry I can’t answer!
Have you tried <body onclick=“…”> ?
That should work, and it’s valid.