JSFiddle - React, Tailwind, and code Playground

by Rejith R Krishnan

HTML

<input type="text" id="nums"/>
<input type="button" id="submit" value="submit"/>

<p></p>

JavaScript

$("document").ready(function() {
        $("#submit").click(function() {
            var nums = $("#nums").val();
            var numsf = nums.split(',');
            var evens = [];
            $.each(numsf,function(i, _this){
                if (parseInt(_this) % 2 == 0)
                    evens.push(_this);
            });
            var res = evens.toString();
            $("p").append(res + "<br>");
        });
    });