JSFiddle - React, Tailwind, and code Playground
HTML
<h2>1</h2>
<h2>2</h2>
<h2>3</h2>
<h2>4</h2>
<h2>5</h2>
JavaScript
$.each($('h2'), function(index, value){
alert($(value).html());
});
<h2>1</h2>
<h2>2</h2>
<h2>3</h2>
<h2>4</h2>
<h2>5</h2>
$.each($('h2'), function(index, value){
alert($(value).html());
});