<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<script type="text/javascript" src="../jquery-validation-1.16.0/lib/jquery-1.11.1.js"></script>
<script type="text/javascript" src="../jquery-validation-1.16.0/dist/jquery.validate.js"></script>
<form id="myform">
<input type="text" name="ues">
<input type="text" name="ps">
<input type="submit" name="sub">
</form>
<script type="text/javascript">
$(document).ready(function(){
$("#myform").validate({
rules:{
ues:{
required:true
}
}
})
})
</script>
</body>
</html>
可以了,原来是要 submit了才显示