JSFiddle - React, Tailwind, and code Playground

by billyonecan

HTML

<div class="memberDiv" style="position:relative">
                <p class="myUserName"><strong>Jo Bloggs</strong></p>
                <p class="myJobTitle">Widget Maker</p>
                <p class="myCountry">England</p>
                <button class="memberMore">MORE INFORMATION</button>
            </div>

JavaScript

$('.memberMore').on('click', function() {
    
    var text = $(this).siblings().map(function() {
        return $(this).text();
    }).get().join(', ');
    
    alert(text);
});