JSFiddle - React, Tailwind, and code Playground

HTML

<form id="checkinput" action="#">
<input type="text" value="" id="couponcode" name="coupon code name"/>
<input type="button" id="submit" value="Submit"/>
</form>

JavaScript

function include(arr, obj) {
    
    for(var i=0; i<arr.length; i++) {
        if (arr[i] === obj) return true;
    }
}

var arr = [ "Cuřínova 585/4, Praha 12 - Kamýk", "Pete", 8, "John" ];

$("#submit").click(function(e){
e.preventDefault();
    
    var val=$("#couponcode").val();
    if(include(arr, val)) 
        alert("success");
        else
        alert("none");
});