JSFiddle - React, Tailwind, and code Playground

HTML

<div id="text"> 
<h1>Witertettgevdgaj</h1> 
</div>

JavaScript

var wartosc = document.getElementById("text").childNodes[1].innerHTML;
if(wartosc.length<10){
	alert("Mniej niz 10");
}
else {
	alert("wiecej niz 10");
}