Removing #anchor links from changing browser URL when clicked

Since no one figured this out (lol), I did some more digging and found a fix. Here it is:

<script src="https://d3e54v103j8qbb.cloudfront.net/js/jquery-3.4.1.min.220afd743d.js" type="text/javascript"></script>
<script>
var Webflow = Webflow || [];
Webflow.push(function() {
  $('a').click(function() {
    setTimeout(function() {
      history.replaceState(null, null, ' ');
    }, 0);
  });
});
</script>
3 Likes