开发者

How to capture click event in prototype

I want to prevent default link click behavi开发者_C百科or. I want that it should not redirect to that link but just show the link in alert box. I have tried this here.

document.on('click', 'a.AjaxLink', function(event, element) {
    alert(element.href);
    return false;
});


this should work

document.on('click', 'a.AjaxLink', function(event, element) {
    event.stop();
    alert(element.href);
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜