Sorry, I assumed he meant he wanted to call the function attached to the onclick.  Your solution works with click events, but there is no ‘mouseover()’ function J  Anyway, as I mentioned, I am tired, and it is Monday, so I wasn’t really sure I was answering the question correctly (waiting for the Mountain Dew to kick in…).

 

Also, doing myform.submit() does not fire the onsubmit handler (I’m sure there’s a good reason, but I dunno what it is), so it isn’t a universal solution.

 

But, yeah, if he wanted to trigger the chain of click events, he’d need to call the click() function.

 

Greg

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ryan Gahl
Sent: Monday, June 12, 2006 9:13 AM
To: [email protected]
Subject: Re: [Rails-spinoffs] Re: Cross Broswer Fire Event

 

That would only execute the function that is attached to the onclick event (if there is one), not actually cause the onclick event to fire. Also, if there was not function attached to the onclick event, that would cause an error. To actually fire the event and cause all event handlers to execute (whether they were attached inline or via the W3C model... use the event name (without the "on") as a function invocation...

myElement.click();

...I know this works for the click event, I've not tested it with the other events though.

On 6/12/06, Eric Anderson <[EMAIL PROTECTED]> wrote:

Gregory Hill wrote:
> var func = myElement.onclick;
> func();

You can get rid of the temp variable:

myElement.onclick();

Eric

_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

 

_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to