JSFiddle - React, Tailwind, and code Playground
HTML
<div class="borded-textbox">Contrary to popular belief Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.</div>
CSS
.borded-textbox
{
width:200px;
position:relative;
}
.endline.processed
{
position:absolute;
bottom:-1px;
left:0px;
height:10px;
display:block;
background-color:red;
z-index:-1;
}
JavaScript
$(".borded-textbox").each(function(index, elem) {
$(elem).html($(elem).html() + "<span class='endline'></span>");
var endline=$(elem).find(".endline");
endline.css('width', parseInt(endline.offset().left));
endline.addClass('processed');
});