开发者

How to capture click event in prototype

开发者 https://www.devze.com 2023-04-12 00:09 出处:网络
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.

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

精彩评论

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

关注公众号