I have this code to check if the size of the user input conforms to some parameters, but the size it returns is always -1 the size of the input content, would it be the case to convert to int and add 1?
$("input").keydown(function() {
console.log($(this).val().length);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><inputtype="number">