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

js input的onblur与onchange的区别

WBOY
Release: 2016-06-01 09:55:00
Original
2543 people have browsed it

onblur:只要input失去焦点就会触发 onblur事件。不管input框里面的值是否改变,都会触发事件。onchange:只有当input框里面的值发生变化才会执行,这里加了值判断 。

请看下面实例:

<code>

  
<meta http-equiv="Content-Type" content="text/html; charset=GB2312"> </code>
Copy after login
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!