Make a HTML link that does nothing (literally nothing)

前端 未结 9 697
耶瑟儿~
耶瑟儿~ 2020-12-13 23:35

I want a link that does nothing. I don\'t want this:

because then the URL becomes something.com/whatever/#.

9条回答
  •  旧时难觅i
    2020-12-13 23:59

    one way which no one has mentioned is to point the href to an empty local file location like so

    my dead link
    

    why? If you use a framework such as react or angular, the compiler will spit out some warnings which can make your log or console dirty. This technique will also prevent robots or spiders from incorrectly linking things.

提交回复
热议问题