JSFiddle - React, Tailwind, and code Playground
by pmamode
HTML
<!DOCTYPE html>
<html>
<body>
<p id="demo">Click the button to display the position of the match.</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction()
{
var arr=[" W3Schools","Pat"];
var str=arr[0];
var n=str.search("W3Schools");
document.getElementById("demo").innerHTML=n;
}
</script>
</body>
</html>