JSFiddle - React, Tailwind, and code Playground

HTML

<div>1</div>
<div id="a2">2</div>

JavaScript

alert(1 == $.inArray($('#a2')[0], $('div')))