HELP! * YELLOW=global GREY=local Global HTML version of Foils prepared 21 February 97

Foil 56 Event Handlers in JavaScript - II

From Feb 17/19 Delivered Lecture for Course CPS616 -- aJavaScript Language Objects and Frames CPS616 spring 1997 -- Feb 17 and 19 1997. by Geoffrey Fox * See also color IMAGE
Secs 84.9
You can set event handlers within HTML TAG using syntax like
  • onclick="whattocall(arg1,arg2...)"
Alternatively set event handler explicitly with
  • document.myform.mybutton.onclick=anotherfunction; // where anotherfunction is a function without arguments and there are NO () in this syntax but you must have () when specifying inside TAG
  • Also note JavaScript is case sensitive and onclick is ALL lower case here but in HTML which is not case sensitive you are free to use any case in ONclicK= " .. " syntax


Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Fri Feb 21 1997