JSFiddle - React, Tailwind, and code Playground
by Pierre LE ROUX
HTML
<input type="text" id="1" placeHolder="first list"/>
<input type="text" id="2" placeHolder="second list"/>
<button onclick="check()">test</button>
<p id="printResult"></p>
JavaScript
var list1 = ["orange", "apple", "banana", "grape", "strawberry"],
list2 = ["bike", "car", "motorcycle", "boat"],
string1, string2;
check = function(){
string1 = document.getElementById("1").value;
string2 = document.getElementById("2").value;
if(list1.indexOf(string1) > -1 || list2.indexOf(string2) > -1){
document.getElementById("printResult").innerHTML = "true";
}else{
document.getElementById("printResult").innerHTML = "false";
}
}