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

js input的onblur与onchange的区别

Jun 01, 2016 am 09:55 AM
blur change input focus

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

请看下面实例:

1

2

3

4

<code>

 

   

<meta http-equiv="Content-Type" content="text/html; charset=GB2312"> </code>

Copy after login
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to implement laravel input hidden field How to implement laravel input hidden field Dec 12, 2022 am 10:07 AM

How to implement laravel input hidden field

How to encapsulate input components and unified form data in vue3 How to encapsulate input components and unified form data in vue3 May 12, 2023 pm 03:58 PM

How to encapsulate input components and unified form data in vue3

C/C++ program to find the vertex, focus and directrix of a parabola C/C++ program to find the vertex, focus and directrix of a parabola Sep 05, 2023 pm 05:21 PM

C/C++ program to find the vertex, focus and directrix of a parabola

How to remove focus in jquery How to remove focus in jquery Feb 17, 2023 am 10:20 AM

How to remove focus in jquery

Comparison of focus and blur methods in jQuery Comparison of focus and blur methods in jQuery Feb 23, 2024 pm 03:51 PM

Comparison of focus and blur methods in jQuery

Detailed explanation of input box binding events in Vue documents Detailed explanation of input box binding events in Vue documents Jun 21, 2023 am 08:12 AM

Detailed explanation of input box binding events in Vue documents

What to do if there is no cursor when clicking on the input box What to do if there is no cursor when clicking on the input box Nov 24, 2023 am 09:44 AM

What to do if there is no cursor when clicking on the input box

How to use the input box carriage return event and verification function in the Vue document How to use the input box carriage return event and verification function in the Vue document Jun 20, 2023 am 09:13 AM

How to use the input box carriage return event and verification function in the Vue document

See all articles