JSFiddle - React, Tailwind, and code Playground

by Brodingo

JavaScript

$('a.toggler:not(.simple-toggle-processed)', context).addClass('simple-toggle-processed').each(function () {
		var $this = $(this),
			togglee = $('.togglee[data-link="' + $this.attr('data-link') + '"]', context),
			text = $this.text(),
			alt = $this.attr('data-text');
			
		$this.click(function (event) {
			event.preventDefault();
			togglee.slideToggle();
		});
		
		// Toggles anchor text ex: Show / Hide
		if (alt) {
			$this.toggle(function () { $this.text(alt); }, function () { $this.text(text); });
		}
	});