JSFiddle - React, Tailwind, and code Playground

HTML

<div id="firstDiv"></div>
<div id="secondDiv"></div>
<div id="thirdDiv"></div>
<div>$.inArray: <span id="span1"></span></div>
<div>Array.indexOf: <span id="span2"></span></div>

CSS

div {margin: 5px}
#firstDiv {height:200px;width:200px;border:solid 1px red}
#secondDiv {height:150px;width:150px;border:solid 1px green}
#thirdDiv {height:100px;width:100px;border:solid 1px blue}

JavaScript

var divArray = new Array();
var thirdDiv = document.getElementById("thirdDiv");
divArray.push(thirdDiv);
$("#thirdDiv").appendTo("#secondDiv");
$("#span1").html($.inArray(divArray, thirdDiv));
$("#span2").html(divArray.indexOf(thirdDiv));