Theres a link i want to click. I also have the HtmlElement of the link. However it is /site/blah/# so i know theres some JS there. How do i simulate the click?
+2
A:
All DOM elements have a click() method - have you tried calling that?
belugabob
2009-07-21 07:12:24
all i see is an event which i cant call.
acidzombie24
2009-07-21 07:28:20
+2
A:
You should be able to just call the click() method
<script type="text/javascript">
element = document.getElementById('thelinkid'); //or whatever other method you used to get the element
element.click();
</script>
monkey_p
2009-07-21 08:09:21
+1
A:
Maybe not the prettiest but this has worked best for me:
webbrowser1.Navigate("javascript:document.forms[0].submit()")
Similarly you can fill out forms, remove elements, etc.
Eyal
2009-12-10 00:21:13