The basic syntax of Jquery:
$("input[type= 'text']").change( function() {
// Here you can write the verification code you want;
});
2 When binding a text box When
$(function () {
$ ("#txtAssessmentTotal").change(function () {
//Write the verification code you want here;
})
})
for each Bind an event handler to a specific event of the matching element. The
.bind() method is the primary way to attach behavior to a document. All JavaScript event objects, such as focus, mouseover, and resize, can be passed in as the type parameter.
My personal understanding of bind is to bind an event to this control and define an anonymous method for this event to achieve the verification you want;
Jquery basic syntax:
$("#txtAssessmentTotal").bind('click', function() {
alert($( "#txtAssessmentTotal").val());
});
2 Multiple events: The names of the events are separated by spaces;
$("#txtAssessmentTotal").bind('mouseenter mouseleave', function() {
alert($("#txtAssessmentTotal").val());
});
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn