JSFiddle - React, Tailwind, and code Playground

HTML

<p class="test"><a href="#">I will load text on click.</a></p>
<div class="contentArea">test</div>

JavaScript

$('.test').on("click", function(e){
    e.preventDefault();
    getContent('../page2.html');
});

function getContent(filename) {
    $.ajax({
        url: '/echo/html/',
        type: 'POST',
        dataType: 'html',
        data: {
            html: '<span>test HTML to send back to client</span>',
            delay: 3
        },
        success: function(data, textStatus, xhr){
            $('.contentArea').html(data);
        },
        error: function(xhr, textStatus, errorThrown){
            $('.contentArea').html(textStatus);
        }
    });
}