JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html>
<body>
<p>An unordered list:</p>
<ul>
<li>Coffee</li>
<li>Tea</li>
<span>Milk</span>
</ul>
<p>Click the button to find out how many li elements there are in this document.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
</body>
</html>
JavaScript
function myFunction() {
var a = document.getElementsByTagName("LI");
var b = document.getElementsByTagName("SPAN");
console.log(a.concat(b));
// expected output: Array ["a", "b", "c", "d", "e", "f"]
}