JSFiddle - React, Tailwind, and code Playground
HTML
<a href="#" id="more-posts">More Posts</a>
JavaScript
function logger() {
console.log('Redirecting...');
}
$("#more-posts").on("click", function(event) {
console.log('Preventing...');
event.preventDefault();
console.log("Showing more posts");
window.setTimeout(logger, 2000);
});