The change using onchange is raised for input, select, and textarea when the any user do changes to the element’s value. Not necessarily the changes occurs every time when the value of any element change. The onchange attribute works when the value of the element changes and select the new value from the List. It is a part of event attribute. It is similar to oninput event attribute. The oninput attribute of select event occurs immediately after the value of element changes, while onchange event occur once the element looses it’s focus i.e. the user has done with the selection. This attribute is associated with element “<select>”. The purpose of the HTML onchange attribute is to indicate the user agent that the value of the element has changed.
Output: You've Selected: third