2
I have that code:
function contar() {
var num_caracteres;
num_caracteres = document.form1.txtTexto.value.length;
document.getElementById("contador").innerHTML = num_caracteres;
setTimeout("contar()", 100);
}
<body>
<form id="form2" name="form1" method="post" action="">
<label>
<input type="text" name="txtTexto" id="txtTexto" onkeypress="contar()"/>
</label>
<p><label id="contador"></label></p>
</form>
</body>
How to make it not count the typed blanks?
and to display an input instead of the label?
– Betinho Silva
@Betinhosilva ready ! example with label and input
– Leonardo Bonetti