JSFiddle - React, Tailwind, and code Playground
by lollero
HTML
<input class="button" type="button" value="Fade In" name="submit"/>
<div class="content">
This is the div which is going to be fadeIn after click
</div>
CSS
.content { display:none; }
JavaScript
$('.button').click(function(){
var tn = $(this).next('.content');
if ( tn.is(':visible') ){
$(this).attr('value', 'Fade In')
}
else {
$(this).attr('value', 'Fade Out')
}
tn.fadeToggle(600);
});