JSFiddle - React, Tailwind, and code Playground

by cmruser

HTML

<a href="test">test</a>

JavaScript

$(document).on('click', 'a', function (e) {
        e.preventDefault();

        var $this = $(this),
            url = $this.attr("href"),
            title = $this.text();

        history.pushState({
            url: url,
            title: title
        }, title, url);

       
    });

    $(window).on('popstate', function (e) {
        var state = e.originalEvent.state;
        console.log(state);
        if (state !== null) {
        } else {
            
        }
    });