JSFiddle - React, Tailwind, and code Playground

HTML

<form id="sage">
    <input name="code" type="text" value="P=Primes(); print P.next(2016)"></input>
    <button>Evaluate</button>
</form>
Output: <div class="output"></div>

JavaScript

$('#sage').submit(function() {
    $.post('http://sagecell.sagemath.org/service', $('#sage').serialize(), function(data) {
        $('.output').html(data.stdout);
    });
    return false;
});