JSFiddle - React, Tailwind, and code Playground

by jelane20

HTML

<div class="CalendarViewAllDayEvent"><a href="http://www.google.com">thisisareallylongword </a></div>

JavaScript

if($('.CalendarViewAllDayEvent a').text().length > 5){
  str = $(".CalendarViewAllDayEvent a").text();
  $('.CalendarViewAllDayEvent a').text(str.substring(0, 5)).append('...');
}