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
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to