I have some buttons which use animated sprite sheets, and therefore must be set as a background image (as far as I know). Currently they use a javascript redirect rather than a href and so the context menu on right click is for a background image.
Ideally I would like it to show the context menu for a link so that ‘open in new tab/window’ (or browser equivalent) can be used from a right click.
I do not want to create a custom context menu, just to have it use the browsers standard menu for links, rather than background images.
Unfortunately google hasn’t been much help in this matter.
The HTML5 specifications updated hyperlinks to allow them to contain flow content. If you want that kind of behavior, you need to wrap them with a hyperlink like @Eliran suggested.
There’s no support for modifying the context menu and the closest thing you have to that is overriding the default right click event handling with something that creates HTML menus.