开发者

how to disable link in jquery

my page have a link

<a href="/hyperlink">Hyper link</a>

i want to open a dialog when user click on link.

i want to disable link without remove href event or attribute from him

means no changes in html

then

when 开发者_C百科user click on link then open a dialog

if jquery not load or have a error cause open a link directly.

how i can do this.


$('#myLink').click(function(e) {
    e.preventDefault();
    //do other stuff when a click happens
});

That may work.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜