JSFiddle - React, Tailwind, and code Playground

by jasongennaro

HTML

<p class="last_wfp">This is the first sentence that I want bold and red. This is the second sentence that I don't want that treatment. This text is lost! And then there was more.  And another sentence...</p>

CSS

.last_bold{
    font-weight:bold;
    color:red;
    padding-top:2em;
    display:inline-block;
}

JavaScript

var a = $('.last_wfp').text();
var b = a.slice(0, a.indexOf('. '));
var c = a.slice(a.indexOf('. '), a.length);

$('.last_wfp').html('<span class="last_bold">' + b + '</span>' + c);