Hi I am trying to detect a ctrl + click on a link and then to send a variable to a js function . I have stripped the code down so I can show it as an example below. I find I can detect the ctrl+click event no problem .
<script language="JavaScript">
function mouseDown(e) {
var ctrlPressed=0;
var evt = navigator.appName=="Netscape" ? e:event;
ctrlPressed =evt.ctrlKey;
self.status="" +"ctrlKey=" +ctrlPressed
if (ctrlPressed)
alert ("Mouse clicked with Ctrl")
return true;
}
document.onmousedown = mouseDown ;
//-->
</script>
`
But want I now want to do is send a variable to my function ie
document.onmousedown = mouseDown("variable")
I appreciate that I am assigning the mouse event to the whole document but in reality this would be a link. (This code is only used in chrome browsers)
If anyone can give me some pointers that would be really helpful
thanks