Why, after conversion to a string, shows "23", and not "5"? And the second question is, why toUpperCase () does not display text between tags in capital letters?
var text = document.getElementById('text'); text = text.toString(); alert(text.length); alert(text.toUpperCase()); <div id="text">Lorem</div>
textvariable? If you want to work with text, then get the textvar text = document.getElementById('text').innerText;- Pyramidhead