I am trying to append a div to pdpTab5 if the tab contains more than 540 charecters. Where i will be creating a “read more…” sort of situation through a modal.
I am truncating the text by using this. But the part of adding a div is making me confused. I dont want to show the div if the tab contains less than 540 charecters.
<script>
$(function(){
var myDiv = $('#pdpTab5');
myDiv.html(myDiv.html().substring(0,540));
});
</script>
Here’s the fiddle.