Guest jstratham84 Posted April 1, 2006 Share Posted April 1, 2006 Hello,I want to display an alert box when clicked on a link. I found out how to do this with left click (on w3schools), but how can I make it so that this alertbox is display both on right and left click? Link to comment Share on other sites More sharing options...
scott100 Posted April 2, 2006 Share Posted April 2, 2006 This would do it for IE, im not sure how you would do it with the other browsers <html><head><script type="text/javascript">function Alert(){if (event.button == 2)alert("Right Click Pressed")else alert("Left Click Pressed");}</script></head><body><a href="#" onmousedown="Alert()">Click Me</a></body></html> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now