开发者

get keyCode on click?

first, see my example : http://jsfiddle.net/Davood/gkeAM/

i want get keyC开发者_运维技巧ode when click on link .

i want found that when clicked on link, ctrl key pressed or not ?

thanks in advance


$('a').click(function(e){
        if(e.ctrlKey)
        {
            alert( 'You pressed ctrl key' );
        }
        else
        {
            alert( 'You clicked on link without ctrl key' );
        }
        return false;
});

DEMO

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜