Hi,
Seems that this syntax is out of favor and I have avoided using this syntax.
However, I have found that href and onclick behave differently while coding for ADA compliance (Americans with Disability Act).
The issue is with folks unable to use a mouse (Carpal Tunnel syndrome, etc?)
In this case, they tend to use tab to get to active elements, and press keyboard enter to activate the href.
If they hit enter when they are focused on a button, the href is used, onclick() is never called (I do have to set href-“#” so I can get focus).
I assume the href=”javascript:dosomething();” syntax would solve my problem.
So, how do I accommodate non-mouse users without the use of href=”javascript:”?
I guess I could do an onmousedown handler as well, and make sure the enter key is being pressed, but if it is OK to use href:javascript this seems to be a less messy solution.
Comments?
Larry