Suppose I load a webpage which contains the following anchor:
<a class="someClass" href="#" onClick="gotoPage('http://somepage.org')">Link</a>
What I want is: as soon as the page is loaded, I want to generate onClick for this anchor which has text as "Link".
Note that the anchor does not contains any id or name associated with it. Thus document.getelementbyid or document.getelementbyname will not work.