Hi I want to be able to count the number of displayed characters in a Div with javascript/jquery. For example
This is my div!&l
In case you are searching for a Vanilla Javascript solution.
Here is one with whitespace:
document.querySelectorAll('#mydiv')[0].textContent.length
Here is one without whitespace:
document.querySelectorAll('#mydiv')[0].textContent.replace(/\s/g,'').length