script links without href=“#”

前端 未结 6 1950
终归单人心
终归单人心 2020-12-02 14:25

My web application uses a lot of Perform client script action anchor links which are used for scripting (a habit I picked-up from

6条回答
  •  既然无缘
    2020-12-02 15:14

    Personally I prefer to use href="javascript:void(null);", to give the browser an href that won't mess up any other use of hashes.

    The only difference I've noticed about href-less links is that the browser will not underline them by default, so just add that style in and you should be good.

提交回复
热议问题