Saturday, 15 August 2015

javascript - How can I stop tag jumping to the target which is specified by href attribute? -



javascript - How can I stop <a> tag jumping to the target which is specified by href attribute? -

this question has reply here:

jquery disable link 11 answers

i know <a href="javascript:void(0)">link</a> job,

but intend specify href, not jump when beingness clicked, like:

<a href="http://mydomain.com" onclick="...">link</a>

when click on link, i'd onclick invoked, whereas href 'show' without jumping http://mydomain.com.

how done javascript or css? lot!

add class link, example: class="not-jump"

then in jquery add together listener:

$( ".not-jump" ).click(function(e) { e.preventdefault(); });

that should trick.

javascript jquery html css

No comments:

Post a Comment