G
G
godsplane2019-10-28 06:59:11
JavaScript
godsplane, 2019-10-28 06:59:11

Appearance and disappearance of the button "Show in full" depending on the length of the text?

How to make such check on js/jq?
If we allow more than 200 characters in the block, then show the button, if less then do not show it.?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2019-10-28
@godsplane

const str = 'Очень длинная строка';

if (str.length <= 200) {
  document.querySelector('.button').style.display = 'none';
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question