JSFiddle - React, Tailwind, and code Playground

by wewo

HTML

<table id="toto_riesim">
<tbody><tr class="hd"><th>249 countries</th><th>A-2</th><th>A-3</th><th>Num</th><th>ITU</th><th>GEC</th><th>IOC</th><th>FIFA</th><th>DS</th><th>WMO</th><th>GAUL</th><th>MARC</th><th>Dial</th><th>Independent</th></tr>
<tr class="o"><td><a href="uaf.html">Afghanistan</a></td><td><code>AF</code></td><td><code>AFG</code></td><td><code>004</code></td><td><code>AFG</code></td><td><code>AF</code></td><td><code>AFG</code></td><td><code>AFG</code></td><td><code>AFG</code></td><td><code>AF</code></td><td>1</td><td><code>af</code></td><td>93</td><td>Yes</td></tr>
<tr class="e"><td><a href="uax.html">Åland</a></td><td><code>AX</code></td><td><code>ALA</code></td><td><code>248</code></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td><code>ALD</code></td><td><code>FIN</code></td><td>&nbsp;</td><td>1242</td><td>&nbsp;</td><td>358</td><td>Part of FI</td></tr>
<tr class="o"><td><a href="ual.html">Albania</a></td><td><code>AL</code></td><td><code>ALB</code></td><td><code>008</code></td><td><code>ALB</code></td><td><code>AL</code></td><td><code>ALB</code></td><td><code>ALB</code></td><td><code>AL</code></td><td><code>AB</code></td><td>3</td><td><code>aa</code></td><td>355</td><td>Yes</td></tr>
<tr class="e"><td><a href="udz.html">Algeria</a></td><td><code>DZ</code></td><td><code>DZA</code></td><td><code>012</code></td><td><code>ALG</code></td><td><code>AG</code></td><td><code>ALG</code></td><td><code>ALG</code></td><td><code>DZ</code></td><td><code>AL</code></td><td>4</td><td><code>ae</code></td><td>213</td><td>Yes</td></tr>
<tr class="o"><td><a href="uas.html">American Samoa</a></td><td><code>AS</code></td><td><code>ASM</code></td><td><code>016</code></td><td><code>SMA</code></td><td><code>AQ</code></td><td><code>ASA</code></td><td><code>ASA</code></td><td><code>USA</code></td><td>&nbsp;</td><td>5</td><td><code>as</code></td><td>1-684</td><td>Territory of US</td></tr>
<tr class="e"><td><a...

JavaScript

<!-- $('#toto_riesim tr td:nth-of-type(2)').map((i,el) => $(el).text()).map(data => console.log(data)) -->

const allStates = $.map($('#toto_riesim tr td:nth-of-type(2)'), function( el, i ) {
	return $(el).text()
}).join(' ');

console.log(allStates);