0

I am trying to click on link with has href=javascript:void(0);

I have tried it with tag name but not working.Tag not able to find the href-javascript void (0).

Thanks for replying..

Could you please let me know how to find out the which java script is there on the link?

pnuts
  • 58,317
  • 11
  • 87
  • 139

1 Answers1

0

Typically, these <a> anchor elements have an onClick event. You need to inspect the element and determine what script is being executed together with what (if any) parameters.

ie.Document.parentWindow.execScript "theScript();", "javascript"

Sorry but without knowing the URL and element that you are trying to get through, it is pretty much impossible to offer more.

See How can I pass variable parameters into a Javascript Function using Excel VBA for more information.

Community
  • 1
  • 1
  • Hi..the element has onclick evnet...I have used function ie.Document.parentWindow.execScript "function onclick(Event){return false;}", "javascript"...but it is not clicking on the link...Please help – Dhanashree Kulkarni Sep 09 '15 at 06:46
  • You are just going to have to drill a little deeper into what sounds like nested javascript functions and possible a rewrite in the form's action property. As I've implied in my response, there is no way to provide direct help without knowing the URL (and possibly credentials) of the wen page in question. –  Sep 09 '15 at 07:06