javascript - How can I show specific texts inside a div by the click of a button? - Stack Overflow

PHOTO EMBED

Fri May 29 2020 11:38:37 GMT+0000 (Coordinated Universal Time)

Saved by @Amna #javascript

$(document).ready(function(){
        $('.btnWrapper button').click(function(){
            $('.btnWrapper button').removeClass('active');
            $(this).addClass('active');
            var realtion = $(this).data('relation');
            $('.translatedText>div').removeClass('active');
            $('.translatedText').find('#' + realtion).addClass('active');
        });
        
    });
content_copyCOPY

https://stackoverflow.com/questions/62084454/how-can-i-show-specific-texts-inside-a-div-by-the-click-of-a-button