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.
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn