I have a page where I have the following code, first HTML, second JS
<div class='container'>
<div id='bradnav' class='breadnav clearfix'><a href='#' class='breadnava'><i class="fa fa-backward" aria-hidden="true"></i> Вернуться</a></div>
</div>
$(".breadnava").click(function (){
window.history.back();
});
The problem with this code is that I also have a link on the page that is expanding hidden divs, with click on it, and this link has a href attribute set to #.
So as soon as I visit the page the link is smth like https://localhost/ikeen/keens.php?topicid=1 and I can use return link well, however when I click the link to expand hidden div-elements the URL naturally becomes https://localhost/ikeen/keens.php?topicid=1# (with the # at the end).
In the latter case I have to click return link twice to return to the page I came from. I know it's a small issue, but is there a way to go back to previous URL in JS, without having to go through all the links pressed on the page itself?
Thank you.