Home > Web Front-end > JS Tutorial > body text

Form Element Events_javascript skills

WBOY
Release: 2016-05-16 18:49:50
Original
1092 people have browsed it

Attribute value description
onchange script executes the script when the element changes
onsubmit script executes the script when the form is submitted
onreset script executes the script when the form is reset
onselect script executes when the element is selected Script
onblur script executes the script when the element loses focus
onfocus script executes the script when the element gains focus

The w3c standard describes it this way.

However, I found that IE can execute it (but if you test onfocus under Safari, do not use alert(), it will pop up infinitely.), but other browsers cannot implement it. IE has always been a disobedient master and is privatistic...but sometimes it is really useful to use the above events in non-form elements. You can set the tabindex attribute on non-form elements. Let other browser non-form elements respond to events. This should be considered a hack (it does not meet the standards, but it is also a helpless move). But it’s really useful

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!