The HTML Attribute reference.

"onchange" - html Event

  • The onchange event occurs when a control loses the input focus and its value has been modified since gaining focus.

Value(s): One or more script statements each ended with a semicolon.

Event "onchange" example:
  <form name="myform" action="">
   <input type="text" name="q" value="w3c"
    onchange="alert(this.type+' lost focus and have been changed')"/>
    Focus test:
   <input type="checkbox"
    onfocus="document.myform.q.value=this.type+' in focus';"
    onblur="alert(this.type+' lost focus')"/>
   <button id="mybutton" title="Show on goggle"
        type="submit" value="Search">
        Search google</button>
Used in the element(s):
Elements Description
input This element defines a form control for the user to enter input.
select This element defines a form control for the selection of options. It is is most useful within a FORM.
textarea This element is used in forms to get multiple lines of text from the user.

© 2010 by Finnesand Data. All rights reserved.
This site aims to provide FREE programming training and technics.
Finnesand Data as site owner gives no warranty for the correctness in the pages or source codes.
The risk of using this web-site pages or any program codes from this website is entirely at the individual user.