U
U
Uzair Izha2015-11-04 18:49:31
HTML
Uzair Izha, 2015-11-04 18:49:31

How to make a link that doesn't reload the page?

I have a regular link.
<a href="#"> </a>
When you click on it, the page does not reload, but the page takes you up. Is there something like that? so that clicking on the link is not noticeable.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
E
entermix, 2015-11-04
@UZEIR

<a href="" onclick="return false;"> </a>

Y
Yaroslav Lyzlov, 2015-11-04
@dixoNich

Hang the handler and cancel the browser action.

$('a').on('click', function (e) { e.preventDefault() })

S
Sergey Sulakov, 2015-11-04
@web-verzus-team

<a href="javascript:void(0)"> </a>

S
shagguboy, 2015-11-04
@shagguboy

P
prodavec macdonalds, 2015-11-04
@prodavecmacdonalds

<a href="#nameOfId"> </a>it should refer to the id in the page code and will shift the screen to its place in the block with the given id, for example<a href="#header"> </a>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question