JSFiddle - React, Tailwind, and code Playground

by csnsgiri

HTML

Pseudo-Human check.

<br/>How much is: <input type="text" id="a" disabled/>
<br/>Answer:<input type="text" id="b"/>

<br/>
<input type="button" id="c" value="Go!"/>

JavaScript

$(document).ready(function() {
    var n1 = Math.round(Math.random() * 10 + 1);
    var n2 = Math.round(Math.random() * 10 + 1);
    $("#a").val(n1 + " + " + n2);
    $("#c").click(function() {
        if (eval($("#a").val()) == $("#b").val()) {
            alert("Ok! You are human!");
        } else {
            alert("error");
        }
    });
});