Note: The main function is to listen to your errors. If there are any errors, the system will slide to the prompt, and the speed can be set, which is super user-friendly, but the error binding must have the id attribute, id is the unique id card for your verification. Because code is used in the project, such as where the listening event should be encapsulated, and special verification classes should be added, you can get back to the problem of time, if you have any of the following questions, please leave a message: list the two classes and the demonstration will not be listed because the style is too bad to read! [Javascript]/*** error store class */var Errortop = {setErrorTop: function (_ this) {var height = jQuery (_ this ). offset (). top; validateExam. put (height, height, jQuery (_ this ). attr ('id');}, getErrorTopTip: function (min, time) {if (validateExam. keys. length> 0) {var maxhight = Math. max. apply (null, validateExam. keys); jQuery ('html, body '). animate ({scrollTop: maxhight-min}, time); // alert (validateExam. obj [Maxhight]); jQuery ("#" +validateexam.obj?maxhight=#.focus().css ('bordercolor', 'red') ;}, remove: function (id) {validateExam. remove (id) ;}/ *** error collection class */function CollectionError () {this. keys = new Array (); this. data = new Array (); this. obj = new Array (); this. distinct = new Array (); this. put = function (key, value, id) {if (this. data [key] = null) {this. keys. push (key); this. da Ta [key] = value; this. obj [key] = id; this. distinct [id] = key ;}}; this. get = function (key) {return this. data [key] ;}; this. indexOf = function (val) {for (var I = 0; I <this. keys. length; I ++) {if (this. keys [I] = val) return I;} return-1 ;}; this. removekey = function (val) {var index = this. indexOf (val); if (index>-1) {this. keys. splice (index, 1) ;}}; this. remove = function (id) {if (this. d Istinct [id]! = Null) {var key = this. distinct [id]; this. distinct [id] = null; this. removekey (key); this. data [key] = null; this. obj [key] = null ;}}; this. size = function () {return this. keys. length ;};}