Home
Run >
<!DOCTYPE html> <html> <head> <!-- www.techstrikers.com --> <title>My first Javascript code</title> </head> <body bgcolor="#bnde45"> <fieldset> <legend>Javascript Change Event</legend> <SCRIPT LANGUAGE="JavaScript"> function valid(form){ var input=0; input=document.myform.data.value; alert("You have changed the value from 10 to " + input ); } </SCRIPT> </HEAD> <BODY> <H3>Example of onChange Event Handler</H3> Try changing the value from 10 to something else:<br> <form name="myform"> <input type="text" name="data" value="10" size=10 onChange="valid(this.form)"> </form> </fieldset> </body> </html>