You should be able to read it using xpath or some other technique.

I don't believe you can set it directly with watir.  However you can always
inject javascript that will change the handler.  Something like:

@ie.Document.parentWindow.execScript("$('eleid').onclick = 'alert('hi');');

I didn't test that and I'm pretty sure the embedded " and ' are wrong but
you should be able to get the idea of how to set the handler.

-andy


On Wed, Mar 11, 2009 at 10:33 AM, <andrew.d...@lthree.com> wrote:

>
> So I am clicking on a link that has an onclick handler. I would like
> to read/write the onclick handler. Is there a way to get at that. Just
> trying
>
> element.onclick = "sss"
>
> didn't work and neither did
>
> element.click = "sss"
>
> Is there a way to do this?
>
> Andy
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to