[thelist] Events

Peter-Paul Koch gassinaumasis at hotmail.com
Fri Nov 1 15:34:00 CST 2002


> > I have a number of elements on a page, each with an id. I
> > want certain javascript functions to fire on certain events,
> > but I don't want to specify event handlers in any tags nested
> > within (but not including) the body. If I have a function
> > Init() that fires on page load, is there some way I can do
> > the following (the code is incorrect and for illustrative
> > purposes only):
> >
> > function Init() {
> >   var foo = document.getElementById("bar");
> >   foo.onClick = alert("Eureka!");
> > }

See http://www.xs4all.nl/~ppk/js/index.html?events_tradmod.html for an
extremely lengthy introduction to this way of event handler registration.

ppk

_________________________________________________________________
Unlimited Internet access -- and 2 months free!  Try MSN.
http://resourcecenter.msn.com/access/plans/2monthsfree.asp




More information about the thelist mailing list