Href=“#” Don't Scroll

后端 未结 11 2288
暗喜
暗喜 2020-12-05 01:55

I am pretty new to JS - so just wondering whether you know how to solve this problem.

Current I have in my code



        
11条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-05 02:27

    One option available to you is not to use href = "#"but instead href = "javascript:;" this will allow you to run the onclick handler whilst not scrolling.

    For Example

    Do Something
    

提交回复
热议问题