What does “[removed]void(0)” mean?

前端 未结 14 1352
说谎
说谎 2020-11-21 15:23
login

I\'ve seen such hrefs many times, but I don\'t know what exactly

14条回答
  •  感情败类
    2020-11-21 15:56

    There is a huge difference in the behaviour of # vs javascript:void(0);.

    # scrolls you to the top of the page but javascript:void(0); does not.

    This is very important if you are coding dynamic pages because the user does not want to go back to the top when they click a link on the page.

提交回复
热议问题