Change the idea into a keyboard key event, as follows:
Here One problem is that the content you copy and paste cannot trigger this event. Here are some related codes:
function fNameChange(){
if($('#txtName').val().length<6){
jQuery("#checkSta").html("Name is too short!").css("color"," red");
}else{
myajax();
}
}
Here are some contents searched online:
//onload() event
$(function(){//The event is indeed It was added, but the timing of execution is wrong.
$('#txtName').change(function(){fNameChange();});
})
/*This is what someone said. js implementation, I found that it cannot be used.
*/
For now Solution, if anyone has a real onchange() method, please tell me, thank you.