I'm new to jQuery and I've tried to make something but I failed so here is my problem when the user type it works but when the user paste something didn't work !!
$(document).ready(function(){
$('#username').keyup(username_check);
});
the username_check function :
function username_check(){
var username = $('#username').val();
if(username == "" || username.length < 4){
alert("error");
}
the field :
<input type="text" id="username" name="username" required>
If you want to capture all input
events:
$('#username').on("input", username_check);