JSFiddle - React, Tailwind, and code Playground

by DanEvans

HTML

<div class="entry-content">
    <h2 class="post-title">
        <a href="#">Post #1</a>
    </h2>
    
    <p>Lots of other text and elements</p>
    
    <span class="reaction-count">
        <br><a href="#">Post #1 Comments</a>
    </span>
</div>
<hr>
<div class="entry-content">
    <h2 class="post-title">
        <a href="#">Post #2</a>
    </h2>
    
    <p>Lots of other text and elements</p>
    
    <span class="reaction-count">
        <br><a href="#">Post #2 Comments</a>
    </span>
</div>

CSS

.reaction-count a{
    padding: 5px;
    border-radius: 5px;
    background: #eee;
    font-size: 14px;
}

h2{
    font-family: sans-serif;
    font-size: 24px;
}

JavaScript

$('.entry-content').each(function(){
    $(this).find('.reaction-count').appendTo('.post-title');
});