JSFiddle - React, Tailwind, and code Playground

by mckennatim

HTML

<div class="prog-day">
	<div class="prog-clear" data-role="controlgroup" data-type="horizontal">
		<a href="#" data-role="button" data-mini="true" data-theme="b">Clear</a>
    </div>	
    <p></p>
</div

JavaScript

$(".prog-day a").click(function() {
		console.log("clicked a day button");
	    progToggle = $(this).attr("progToggle");
	    if ( progToggle == "1"  ) {
	    	$(this).attr("data-theme","b").refresh;
	        $(this).attr("progToggle","0");
	        $(this).trigger('create');
	        $(this).trigger('refresh');
	        $('.prog-day p').html($(this).attr("progToggle")+$(this).attr("data-theme"));
	        progToggle = $(this).attr("progToggle");
	     }
	     else {
	     	$(this).attr("data-theme","d").refresh;
	        $(this).attr("progToggle","1");
	        $(this).trigger('create');
	        $(this).trigger('refresh');
	        $('.prog-day p').html($(this).attr("progToggle")+$(this).attr("data-theme"));
	        progToggle = $(this).attr("progToggle");
	    }			
	});