The space key also becomes a character?
My problem is that even if in the input #userChat
there is only the space key itself so the alert()
, and this ends up being a big problem ..
Keys: Space and Line Break. I need that I can only give alert
if you have actually written something, Characters, Letters, numbers, symbols, just things.
$('.butSend').click(function() { var mensagem = $("#userChat").val(); var n = mensagem.length; if(n > 0){ alert(mensagem); } });