-1

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?

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

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
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.