<html>
<body>
<h2>JavaScript Array.indexOf()</h2>
<p id="demo"></p>
<script>
var fruits = ["Apple", "Orange", "Apple", "Mango"];
var a = fruits.indexOf("Apple");
document.getElementById("demo").innerHTML = "Apple is found in position " + a;
</script>
<p>The indexOf() does not work in Internet Explorer 8 and earlier versions.</p>
</body>
<!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_array_indexof by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:28:14 GMT -->
</html>