JSFiddle - React, Tailwind, and code Playground

by ariehg

HTML

<script src="http://github.com/arieh/FunctionStack/raw/master/Source/FunctionStack.js"></script>
<p><a href='#' id='stepper'>Step</a></p>
<p>Enter a value:</p>
<p><input type='text' id='newvalue'/></p>
<strong>Results:</strong>
<div id='result'>1. I will change</div>

CSS

#result{font-family:"Courier New"; border:1px solid #abc; margin-top:10px;}
strong{display:block; margin:10px; font-weight:bold}

JavaScript

var stack = new FunctionStack(
    function(value){$('result').set('html','2. changed to '+value)},
    function(value){$('result').set('html','3. changed again to '+value)},
    function(value){$('result').set('html','4. changed last time to '+value)}
);

$('stepper').addEvent('click',function(){stack.step($('newvalue').value)});