pacman pacman - 1 year ago 150
HTML Question

What is the difference between onBlur and onChange attribute in HTML?

When is one called versus the other? Is there a situation were onChange would be called but onBlur would not be called?

Answer Source

The onBlur event is fired when you have moved away from an object without necessarily having changed its value.

The onChange event is only called when you have changed the value of the field and it loses focus.

You might want to take a look at quirksmode's intro to events. This is a great place to get info on what's going on in your browser when you interact with it. His book is good too.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download