event.js
document.getElementById("width").onchange = checkDimensions;
checkDim.js
function checkDimensions() {
document.getElementById("width").value = "HELLO";
return false;
}
index.html
<?xml version = "1.0" encoding = "utf-8" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "[url="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd[/url]"> <html xmlns = "[url="http://www.w3.org/1999/xhtml"]http://www.w3.org/1999/xhtml[/url]"> <head> <title>Canvas Printing Calculator</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link rel="stylesheet" href="style.css"/> <script type="text/javascript" src="event.js"> </script> </head> <body> <form action=""> <input type="text" id="width" size="30"/> </form> </body> <script type="text/javascript" src="checkDim.js"> </script> </html>







