I have title and description in my div and I have the requirement that if the title length is more than one line then I have to hide the description using JQuery.
<div class="text">
<div>
<div class="text_title">Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum </div>
<div class="text_description">Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem IpsumLorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum</div>
</div>
</div>
I tried different approach from below links but nothing is working for me yet.
How can I count text lines inside an DOM element? Can I?
Also I tried with character count but this is not a good solution as the screen layout may change.