JSFiddle - React, Tailwind, and code Playground

HTML

<a href="a1.php"></a>
<a href="a2.php"></a>

JavaScript

alert($("//a").length);