JSFiddle - React, Tailwind, and code Playground

by Rambabu Pudi

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/jQuery.dotdotdot/1.7.2/jquery.dotdotdot.min.js"></script>
<div class="myText">
  <span>sometextLongText1LongText2LongText3LongText4LongText5LongText...

CSS

p {
    margin:0;
    padding:0;
    font:12px/15px Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif;
}
.myText {
    height:40px; /*  this needs to be the height of 5 lines of text. Here it is 15px (line-height of one line) * 5 = 75px */
    width:60px;
}

JavaScript

$(document).ready(function() {
	$(".myText").dotdotdot();
});