Trying to implement a fade-in effect on text when clicking a button. Any assistance would be greatly appreciated!
$(".btnClick").click(function(event) {
var x = $(this).text();
if (x == "PowerApps") {
$(this).parent(".show-details").find('.show-me').fadeIn(500);
} else {
$(this).text("PowerApps");
$(this).parent(".show-details").find('.show-me').fadeOut(500);
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<div class="show-details">
<button class="btn btn-dark btnClick">PowerApps</button>
<div class="show-me">
<h4>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Lorem ipsum dolor, sit amet consectetur adipisicing elit. Lorem ipsum dolor, sit amet consectetur adipisicing elit.</h4>
</div>
<button class="btn btn-dark btnClick">Operational Efficiency</button>
<button class="btn btn-dark btnClick">Together</button>
</div>