Hi there,
It’s some pretty simple HTML and jQuery.
For example, the HTML:
<div class="review-container">
<p>
Are you happy with our support? <span class="happy">Yes</span> <span class="unhappy">No</span>
</p>
<div class="happy" style="display: none;">
<p>Great to hear!</p>
</div>
<div class="unhappy" style="display: none;">
<p>Sorry to hear that!</p>
</div>
</div>
And the jQuery:
$( '.review-container span.happy' ).on( 'click', function() {
var _this = $( this );
_this.closest( 'p' ).hide();
_this.closest( '.review-container' ).find( 'div.happy' ).show();
} );
$( '.review-container span.unhappy' ).on( 'click', function() {
var _this = $( this );
_this.closest( 'p' ).hide();
_this.closest( '.review-container' ).find( 'div.unhappy' ).show();
} );
There are other ways to do it as well if you Google “jQuery show hide toggle” π