Form Element event (Form Element Events)

Source: Internet
Author: User

Attribute value description
Onchange Script: Execute the script when the element changes
Onsubmit Script: Execute the script when the form is submitted
Onreset Script: Execute the script when the form is reset.
Onselect Script: Execute the script when the element is selected
Onblur script executes the script when the element loses focus
Onfocus Script: Execute the script when the element gets the focus

The w3c standards are described in this way.

However, it is found that IE can be executed (however, if you are testing onfocus, do not use alert (), it will pop up infinitely .), Other browsers cannot. IE has always been an disobedient master and is engaged in private ........... however, it is useful to use the above events in non-form elements. You can set the tabindex attribute for non-form elements to allow non-form elements of other browsers to respond to events. This should be regarded as an hack (not compliant with the standard, but it is also helpless ). But it does work.

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.