Home >Web Front-end >JS Tutorial >js input的onblur与onchange的区别

js input的onblur与onchange的区别

WBOY
WBOYOriginal
2016-06-01 09:55:002590browse

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

请看下面实例:

<code>

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