引入js
<script src="../Admin/role/js/jquery-1.7.1.min.js"></script>
<input name="usermobile" id="usermobile" placeholder="请输入手机号" type="text" style="width:320px; height:40px"><br>
<span id="phone"></span>
jQuery方法
<script type="text/javascript">
$("#usermobile").mouseleave(function() {
var usermobile = $("#usermobile").val();
if(usermobile == ""){
$("#phone").text("请填写手机号").css("color", "red");
return;
}
else{
$("#phone").text("").css("color", "red");
}
});
</script>