< ;meta charset="utf-8"/>
<script> <br>$(function(){ <br>$(":input.required").each(function(){ <br>var $required = $("<strong>* </strong>"); <br>$(this).parent().append($required); <br>}); <br>$(":input.required").blur(function() { <br>//Determine who the mouse left is<br>if($(this).is("#username")){ <br>$(".formtip").remove(); <br>/ /Verify according to the rules of username<br>if(this.value==""||this.value.length<6){ <BR>var errMsg = "<span class='formtip'>Username At least 6 letters</span>"; <br>$(this).parent().append(errMsg); <br>}else{ <br>var msg = "<span class='formtip' >Username can use</span>"; <br>$(this).parent().append(msg); <br>} <br>} <br>//Check if it is an email, It should be verified according to the rules of email <br>if($(this).is("#email")){ <br>$(".emailtip").remove(); <br>//Follow the rules of email To verify <br>var reg = /^w{1,}@w .w $/; <br>var $email = $("#email").val(); <br>if(!reg.test ($email)){ <br>var errMsg = "<span class='emailtip'>Illegal email address</span>"; <br>$(this).parent().append(errMsg); <br>}else{ <br>var Msg = "<span class='emailtip'>The email can be used</span>"; <br>$(this).parent().append(Msg); <br>} <br>} <br>}); <br><br><br>}) <br></script>