Basic Jquery Syntax:
Copy codeThe Code is as follows:
$ ("Input [type = 'text']"). change (function (){
// Here you can write the verification code you want;
});
2. When binding a text box
Copy codeThe Code is as follows:
$ (Function (){
$ ("# TxtAssessmentTotal"). change (function (){
// Write the verification code you want here;
})
})
Bind an event handler for a specific event of each matching element.
The. bind () method is the main method used to add behavior to the document. All JavaScript event objects, such as focus, mouseover, and resize, can be passed in as type parameters.
Personally, bind is to bind events to this control and define an anonymous method for this event to implement the verification you want;
Basic Jquery Syntax:
Copy codeThe Code is as follows:
$ ("# TxtAssessmentTotal"). bind ('click', function (){
Alert ($ ("# txtAssessmentTotal"). val ());
});
Multiple events: the names of events are separated by spaces;
Copy codeThe Code is as follows:
$ ("# TxtAssessmentTotal"). bind ('mouseenter mouseleave ', function (){
Alert ($ ("# txtAssessmentTotal"). val ());
});