JSFiddle - React, Tailwind, and code Playground
HTML
<div id="my-div">
<h2><span class="mw-headline" id="History">History</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Ruby_on_Rails&action=edit&section=1" title="Edit section: History">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
<p><a href="/wiki/David_Heinemeier_Hansson" title="David Heinemeier Hansson">David Heinemeier Hansson</a> extracted Ruby on Rails from his work on <a href="/wiki/Basecamp_Classic" title="Basecamp Classic">Basecamp</a>, a project management tool by <a href="/wiki/37signals" title="37signals">37signals</a> (now a <a href="/wiki/Web_application" title="Web application">web application</a> company).<sup id="cite_ref-interview-davidhh_3-0" class="reference"><a href="#cite_note-interview-davidhh-3"><span>[</span>3<span>]</span></a></sup> Hansson first released Rails as open source in July 2004, but did not share <a href="/wiki/Commit_(data_management)" title="Commit (data management)">commit</a> rights to the project until February 2005.<sup id="cite_ref-core_4-0" class="reference"><a href="#cite_note-core-4"><span>[</span>4<span>]</span></a></sup> In August 2006, the framework reached a milestone when <a href="/wiki/Apple_Inc." title="Apple Inc.">Apple</a> announced that it would ship Ruby on Rails with <a href="/wiki/Mac_OS_X_Leopard" title="Mac OS X Leopard">Mac OS X v10.5 "Leopard"</a>,<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span>[</span>5<span>]</span></a></sup> which was released in October 2007.</p>
<p>Rails version 2.3 was released on March 15, 2009 with major new developments in templates, engines, <a href="/wiki/Rack_(web_server_interface)" title="Rack (web server interface)">Rack</a> and nested model forms. Templates enable the developer to generate a skeleton application with custom <a href="/wiki/RubyGems" title="RubyGems">gems</a> and configurations. Engines give developers the ability to reuse application pieces...
JavaScript
$(document).ready(function(){
var words = $("#my-div").text().split(' ');
var html = $("#my-div").html();
$.each(words,function(i,val){
html = html.replace(val,'<span class="my-span">'+val+'</span> ');
});
console.log(html);
$("#my-div").html(html)
});