JSFiddle - React, Tailwind, and code Playground

by ryanbrill

HTML

<script src="http://dotdotdot.frebsite.nl/js/jquery.dotdotdot-1.2.1.js"></script>
<div id="wrapper">This is a long string of test</div>
<div id="wrapper">This is a long string of test</div>

<div class="wrapper">This is a long string of test</div>
<div class="wrapper">This is a long string of test</div>

CSS

div {
    width: 100px;
    height: 20px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
}

JavaScript

$(document).ready(function() {
    $("#wrapper").dotdotdot(); // This only runs on the first element
    $(".wrapper").dotdotdot(); // This runs on all elements
})