JSFiddle - React, Tailwind, and code Playground

by thecodeparadox

HTML

<link rel="stylesheet" href="///ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/base/jquery-ui.css">
<p class="some_paragraph">This is a </p>
<p class="some_paragraph">Another sentence here. Interesting information. Very interesting.</p>
<p class="some_paragraph">This is a sentence. Here comes another sentence</p>

<span class="short"></span></br>
<span class="short"></span>

CSS

.short {
 color: #f00;
}

JavaScript

var para = $('.some_paragraph');
var shortest = para.sort(function(a, b) {
    $(a).text().length > $(b).text().length;
}).slice(0, 2);

shortest.each(function(i) {
    $('span').eq(i).html(this.innerHTML)
});