gen228
asked on
How can I detect which button clicked with onclick event handler.
Hi, if I am using the onclick event handler, how can I detect a right or left mouse click. I cannot use the onMousedown handler.
-Thanks noijet
-Thanks noijet
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<script language=JavaScript>
function getClick(e)
{
if (document.all)
{ alert(event.button); }
else if (document.layers)
{ alert(e.which); }
else if (document.captureEvents)
{ alert(document.captureEven ts(Event.M OUSEDOWN)) ; }
}
document.onmousedown=getCl ick;
</script>
function getClick(e)
{
if (document.all)
{ alert(event.button); }
else if (document.layers)
{ alert(e.which); }
else if (document.captureEvents)
{ alert(document.captureEven
}
document.onmousedown=getCl
</script>
gen228,
No comment has been added lately (309 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:
RECOMMENDATION: Award points to kanithi http:#7455082
Please leave any comments here within 7 days.
-- Please DO NOT accept this comment as an answer ! --
Thanks,
mplungjan
EE Cleanup Volunteer
No comment has been added lately (309 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:
RECOMMENDATION: Award points to kanithi http:#7455082
Please leave any comments here within 7 days.
-- Please DO NOT accept this comment as an answer ! --
Thanks,
mplungjan
EE Cleanup Volunteer
ASKER
Thanks for the advice ! I apologize for the delay and thanks for the assist mplungjan !
Thanks
Thanks
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconWindowsFormsArchitecture.asp