This should get you started:

document.observe("dom:loaded", function() {

function init() {
  if($('myDiv')) {
   $('myDiv').observe('click', doSomething)

function doSomething(evt) {
    var element = Event.element(evt);

On Mar 12, 10:53 am, bill <> wrote:
> I want to set an observer in a html fragment loaded into a div.
> I know I can't execute the code  to set up the observer until the new
> code is loaded into the dom but need an example of how to use the
> dom:loaded event to set the handler
> --
> Bill Drescher
> william {at} TechServSys {dot} com

You received this message because you are subscribed to the Google Groups 
"Prototype &" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to