jquery--Form Events

Source: Internet
Author: User
Tags button type

form events. blur (),. focus (),. Change (),. Select (), and. Submit ()

1. Blur () and. focus () working with form Focus

2 . the difference between blur () and. focus () is whether bubbling processing is supported

3. Focus () is generated in the element itself, and. Focusin () is generated in the element containing the element

4. Change () monitor the value of the element changes, pay attention to the triggering of the sequence of behavior

5 input listens for changes in value values, triggers a change event when there are changes, and for radio buttons and check boxes, when the user makes a selection with the mouse, the event triggers immediately

6 Select for the drop-down selection box, the event triggers immediately when the user makes a selection with the mouse

7 textarea multi-line text input box, when there are changes, the change event is triggered after losing focus

8 The Select event occurs when the text in the input element of the textarea or text type is selected

9. Select () triggers the Select event for the element, which invokes all functions bound to the Select event, including the default behavior of the browser, and can prevent the browser from triggering the default behavior by returning false in a bound function

the. Select () event can only be used for <textarea> elements and <input> elements

11   $ele. Select (Handler (eventobject))

$ele. Select ([Eventdata],handler (EventObject)) binds the $ele element, which executes the callback handler function each time the $ele element triggers a click. Can accept a data parameter, in order to solve the problem of data transfer under different scopes

Submit () Monitor the user's actions when submitting a form

$ele. submit () binding the $ele element, without any parameters, is typically used to specify that an event is triggered

$ele. Submit (Handler (EventObject)) binds $ele elements, each time the $ele element triggers a click action executes a callback handler function, can do a lot of action on the feedback of the event

$ele. Submit ([Eventdata],handler (EventObject)) binds the $ele element, each time the $ele element triggers the Click action executes the callback handler function, can accept a data parameter, To solve the problem of data transfer under different scopes

17 by binding the submit event on the <form> element, developers can listen to the behavior of the user's submission form

18 Trigger Sub behavior of the MIT event

<input type= "Submit" >

<input type= "image" >

<button type= "Submit" >

When certain form elements get focus, tap enter (enter)

The form element is the behavior of the default submission form, and the default behavior of the browser needs to be suppressed if it is handled by submit

20 The traditional way is to invoke the event object E.preventdefault () to handle, jquery can be directly in the function of the last end of return false can


jquery--Form Events

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.