JSFiddle - React, Tailwind, and code Playground
by Bhabani Raju
HTML
<input type="text" id="code">
<button onclick="myFunction()">Submit</button>
JavaScript
function myFunction() {
var eventallcode = ["abc","def","GHI2"];
var evntcode = document.getElementById("code").value;
if(eventallcode.includes(evntcode)){
alert('achi');
}else {
alert('nahi');
}
}