开发者

get keyCode on click?

开发者 https://www.devze.com 2023-03-02 20:05 出处:网络
first, see my example : http://jsfiddle.net/Davood/gkeAM/ i want get keyC开发者_运维技巧ode when click on link .

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

精彩评论

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