HTML onchange Event Attribute (original) (raw)

Last Updated : 20 Dec, 2023

The **onchange event attribute works when the value of the element changes and select the new value from the List. It is a part of the event attribute. It is similar to **oninput event attribute. But the difference is that oninput attribute event occurs immediately after the value of the element changes, while onchange event occurs when the element loses focus. This attribute is associated with element.

It is commonly employed in forms to validate or process data upon user interaction and enables real-time updates and validation, enhancing the user experience.

**Syntax:

**Supported Tags:

**Attribute Value:

This attribute contains single value _script which works when onchange attribute called.

**Example:

In this example, we will see the implementation of onchange tag.

html `

onchange event attribute