JSFiddle - React, Tailwind, and code Playground
HTML
<p>This is a the first paragraph with a <a href="#">given link</a>. More text.</p>
<p>This is a second paragraph with <a href="#">another link</a> and text.</p>
JavaScript
var map = $('*').map(function(){
return $(this).text();
}).get()
console.log(map)