Why does history back not work on onclick in Firefox?

后端 未结 4 1724
[愿得一人]
[愿得一人] 2021-02-06 02:50

I don\'t understand why in Firefox, window.history.back() does work on a button:

4条回答
  •  再見小時候
    2021-02-06 03:46

    I think it may be related to the href attribute of the a tag, that get interpreted as a next step in navigation (even if you go back in history).

    Try removing the href attribute from the a.

    As you see, this way it works:

    Demo

    You do need just to fix CSS for the a now

提交回复
热议问题