0 points

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


dashboard

Fri May 29 2020 11:38:37 GMT+0000 (UTC)

Posted 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_copy Copy

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